Given a sequence
$\boldsymbol {k} := (k_1,\ldots ,k_s)$ of natural numbers and a graph G, let
$F(G;\boldsymbol {k})$ denote the number of colourings of the edges of G with colours
$1,\dots ,s$, such that, for every
$c \in \{1,\dots ,s\}$, the edges of colour c contain no clique of order
$k_c$. Write
$F(n;\boldsymbol {k})$ to denote the maximum of
$F(G;\boldsymbol {k})$ over all graphs G on n vertices. This problem was first considered by Erdős and Rothschild in 1974, but it has been solved only for a very small number of nontrivial cases. In previous work with Pikhurko and Yilma, (Math. Proc. Cambridge Phil. Soc. 163 (2017), 341–356), we constructed a finite optimisation problem whose maximum is equal to the limit of
$\log _2 F(n;\boldsymbol {k})/{n\choose 2}$ as n tends to infinity and proved a stability theorem for complete multipartite graphs G.
In this paper, we provide a sufficient condition on
$\boldsymbol {k}$ which guarantees a general stability theorem for any graph G, describing the asymptotic structure of G on n vertices with
$F(G;\boldsymbol {k}) = F(n;\boldsymbol {k}) \cdot 2^{o(n^2)}$ in terms of solutions to the optimisation problem. We apply our theorem to systematically recover existing stability results as well as all cases with
$s=2$. The proof uses a version of symmetrisation on edge-coloured weighted multigraphs.