Following Wigert, various authors, including Ramanujan, Gronwall, Erdős, Ivić, Schwarz, Wirsing, and Shiu, determined the maximal order of several multiplicative functions, generalizing Wigert's result n≤xmaxlogd(n)=loglogxlogx(log2+o(1)). On the contrary, for many multiplicative functions, the maximal order of iterations of the functions remains widely open. The case of the iterated divisor function was only solved recently, answering a question of Ramanujan from 1915. Here we determine the maximal order of logf(f(n)) for a class of multiplicative functions f. In particular, this class contains functions counting ideals of given norm in the ring of integers of an arbitrary, fixed quadratic number field. As a consequence, we determine such maximal orders for several multiplicative f arising as a normalized function counting representations by certain binary quadratic forms. Incidentally, for the non-multiplicative function r2 which counts how often a positive integer is represented as a sum of two squares, this entails the asymptotic formula n≤xmaxlogr2(r2(n))=loglogxlogx(c/2+o(1)) with some explicitly given constant c>0.