WZnO-NH2@H3PW12O40 (WZnO/HPA) nanocomposite is disclosed in the photocatalytic degradation of some pharmaceutical wastes by focusing on methylene blue as a case study. The prepared nanophotocatalyst is characterized by XRD, FT-IR, FESEM, TEM, XPS, PL, UV–Vis, and EDX. Compared to pure ZnO, WO3, and H3PW12O40, the heterojunction nanocomposite of WZnO/HPA shows much better degradation efficacy for methylene blue (MB) under UV–Vis light irradiation. Surprisingly, the heterogeneous catalytic system shows very good activity under the irradiation of sun-light and > 40% degradation is achieved for MB after 90 min. In addition, a range of important polluting drugs were also conducted under the standard photocatalytic conditions. The enhanced photocatalytic degradation efficiency would be due to the reduced recombination of photogenerated electron-holes. It seems that degradation process follows a charge transfer mechanism by means of this effective heterogeneous nanocomposite. Reactive species including OH and •O2− together with h+ are expected to be involved in the photodegradation reaction of MB. The highest photocatalytic activity of WZnO/HPA may be due to the enhanced visible light absorption, electron-hole recombination blockage, lowering of the band gap, and increased number of oxygen vacancies or defects.