Conventionally, palm oil mill effluent (POME) was treated using open ponding system, which nevertheless long retention times and large treatment areas were required. In this report, heterogeneous photocatalysis was used to degrade the POME and simultaneously assessed the biogas formation. Characterization of the chemically prepared hierarchical porous ZnO microspheres showed that wurtzite was the predominant crystalline phase with a band gap energy of 3.22 eV. Moreover, the as-prepared ZnO were assembled by large numbers of interleaving nanosheets and formed an open porous structure. Under UV irradiation, the as-prepared ZnO demonstrated photocatalytic property on POME degradation. The WO3 and Nb2O5 decorated ZnO photocatalysts (WO3/ZnO and Nb2O5/ZnO) with improved photocatalytic performances were also prepared using a simple and rapid way. Significantly, in the presence of WO3/ZnO and Nb2O5/ZnO composites, the degradation of POME achieved 68.3% and 91.7%, respectively after 240 min irradiation. Interestingly, the assessment of the biogas formation showed that the photocatalytic reactions over Nb2O5/ZnO and WO3/ZnO composites generated higher amount of biogas products (CH4 + CO2) compared to that of ZnO. The photocatalytic enhancement was attributed to the high separation efficiency of photogenerated electron–hole pairs based on the formation of heterojunction structures between the WO3/Nb2O5 and ZnO. The observed findings also revealed that the photocatalytic technology using hierarchical WO3/ZnO and Nb2O5/ZnO composites had the potential to efficiently treat wastewater.