In this study, we present an optimization scheme for the resonator distribution in rainbow metamaterials that are constitutive of a Π-shaped beam with parallel plate insertions and two sets of spatially varying cantilever-mass resonators. To improve the vibration attenuation of the rainbow metamaterials at frequencies of interest, two optimization strategies are proposed, aiming at minimizing the maximum and average receptance values respectively. Objective functions for both single and multiple frequency ranges optimization are set up with the frequency response functions predicted by an analytical model. The masses of the two sets of resonators clamped at different side walls of the Π-shaped beams constitute the set of design variables. Optimization functions are solved out with the employment of the Genetic Algorithm method. Dedicate case studies are subsequently conducted to show the feasibility of the proposed scheme. The receptance values are found greatly reduced within the single and multiple optimization frequency ranges. Moreover, it is found that, the maximum value based objective function could lead to optimal structures with wider bandgaps but weaker vibration attenuation, while the optimal structure by the average value based objective function has the opposing trend with narrower bandgaps but enhanced vibration attenuation. Objective strategies should be selected according to the application requirements.