The present invention relates to photonic structures and methods of controlling the optical properties and structural stability of photonic structures by using ionic species. The photonic structure is less crystalline when increasing concentrations of the ionic species are used. In certain embodiments, the ionic species is a transition metal salt. The method allows for production of single crystalline, polycrystalline, or glass-like photonic structures. The method allows for control of the optical properties and structural stability of photonic structures. The resulting photonic structures are useful in a wide range of applications, including sensors, photoactive catalysts, light emitters, and random lasing.