In this study, the Viburnum Opulus-like NiO microstructure was synthesized by doping with various levels of Mg (1, 2, 3, 7, and 13 wt%) with the hydrothermal method. The X-ray diffraction analysis showed the tensile lattice strain and dispersion of Mg dopants in prepared samples. The cubic phase was observed in NiO and NiO with 13 wt% Mg-doping and phase change to rhombohedral was appeared in 1–3 and 7 wt% Mg-doping samples. According to the Urbach energy value, lattice disorder was reduced in 1–3 wt% Mg-doping. The sample with 13 wt% Mg-doping exhibited 3.1 times higher Urbach energy value compared to NiO. The degradation efficiency of the Methylene blue was approximately 92.98% for Mg-doped NiO with 13 wt% Mg in 105 min due to the charge trapping by localized states and reduction of recombination of charges. The photoluminescence showed the efficient electron–hole separation for all Mg-doped samples. The excellent durability and recyclability of photocatalyst over four cycles are representing that this material has a potential application in water remediation.