The NiO nanoparticles, nanorods, and nanoworms were synthesized by a hydrothermal reaction of NiCl2 with NaC2O4, as a precipitation agent, and H2O in the presence of ethylene glycol at different temperatures (100, 140, 180, and 220°C) for 12 h. It was observed that by changing the hydrothermal temperature, one can effectively control the size and morphology of NiO nanostructures. The nanostructures were characterized by X-ray diffraction, Fourier transform infrared, scanning electron microscopy, transmission electron microscopy, and diffuse reflectance spectroscopy. Photocatalytic activity of nanostructures against 4-nitrophenol was investigated under ultraviolet and visible light irradiation. The results indicated that photocatalytic activity of NiO nanoworms synthesized at 220°C was higher than that of the other prepared NiO nanostructures.