Herein, we have developed Ln2Ce2O7 (Ln = Er, Ho) ceramic nanostructures through a rapid and green sonochemical approach and scrutinized their photocatalytic efficiency toward degradation of toxic pollutants under sunlight. Salvia rosmarinus extract is utilized as a morphology-directing agent in the sono-synthesis of the nanostructured Ln2Ce2O7 (Ln = Er, Ho), for the first time. Comprehensive characterization utilizing different techniques demonstrated that introducing of rare-earth metals, erbium and holmium, affected the textural, morphological, and optical features of the nanostructured ceria. The energy gap for pure cerium dioxide nanostructure was estimated to be 3.09 eV, while the energy gap for Ho2Ce2O7 and Er2Ce2O7 nanostructure was estimated at 2.9 and 2.66 eV, respectively. The narrowing of the energy gap was observed as a result of the introduction of rare-earth metals, erbium and holmium, especially erbium, into the nanostructured ceria. Investigation of the photocatalytic decomposition of various contaminants revealed that the introduction of erbium has remarkably enhanced the photocatalytic activity of nanostructured ceria. High photocatalytic performance (98.9%) and rate constant (0.0727 min−1) was observed for the Er2Ce2O7 nanostructure in the removal of eriochrome Black T. Improving the optical features of ceria nanostructure as well as enhancing its specific area were reasons that could increase the photocatalytic efficiency. The photocatalytic decomposition reactions in the removal of toxic contaminants were well accorded with the Pseudo-first order reaction kinetics. Besides, the nanostructured Er2Ce2O7 maintained its efficiency after ten reaction cycles and did not denote any notable decline in efficiency. The use of this novel porous nanostructure can be a potentially efficient solution for water treatment.