Widening the light harvesting range and suppressing the fast recombination of excited electrons and holes are of paramount significance in the area of photocatalysis. In the present study, we report a two-step method for the synthesis of metal oxide (ZnO and Fe3O4) deposited on CuO nanowire arrays over 3D copper foam using thermal oxidation followed by microwave assisted deposition. The structural and morphological analysis was carried out using scanning electron microscopy (SEM), transmission electron microscopy (TEM) and X-ray diffraction techniques which support the formation of uniform CuO nanowires and subsequent hierarchical nanostructures. The resulting heterostructures showed enhanced photocatalytic activity towards dye degradation compared to their individual counterparts under solar radiation. The enhanced photocatalytic activity of the heterostructures could be explained in terms of better charge separation due to the formation of a p–n junction at the interface of the p-type (CuO) and n-type (ZnO/Fe3O4) semiconductors. The separation efficiency was further affirmed by photoluminescence (PL) studies. The effect of pH on the dye degradation efficiencies was inspected over the wide pH range of 4–11. Finally, the stability and reusability of the hierarchical nanostructures was estimated using cycling experiments (n = 3). Thus, this rational design of a 3D hierarchical foam was explored towards the development of highly efficient photocatalysts for the degradation of organic pollutants under the abundant sunlight.