The significant improvement of decolorization and disinfection technologies has been a hotspot in wastewater reutilization. In this study, we realized a novel construction of K-doped nano-ZnO and borneol based hydrogel composite material (K-ZnO/B-hydrogel) by low-temperature in situ sol-gel growth. The techniques such as fourier transform infrared (FTIR), X-ray diffraction (XRD), X-ray photoelectron spectroscopy (XPS), scanning electron microscope (SEM) and X-ray energy dispersive spectroscopy (EDS) were applied to recognize the synthesized hydrogel. The results reveal that K-doped ZnO nanoparticles have been uniformly decorated onto the B-hydrogel. Ultraviolet-visible (UV-Vis) absorption spectra show that impurity doping of potassium element into ZnO could reduce the band gap, improving the visible light absorption efficiency. In virtue of photodegradation and antimicrobial experiments, K-ZnO/B-hydrogel exerts great advantage for methylene blue (MB) removal, Escherichia coli (E. coli) and Staphylococcus aureus (S. aureus) sterilization under visible light irradiation. This composite will push ahead with a closed-loop wastewater treatment system for dye and pathogenic microorganism disposal, which combines the excellent adsorption ability of hydrogel and the outstanding photocatalytic ability of ZnO nanoparticles with easy sample handling and separation, and help to eliminate secondary pollution.