Light-harvesting and charge collection have attracted increasing attention in the domain of photovoltaic cells, and can be facilitated dramatically by appropriate design of a photonic nanostructure. However, the applicability of current light-harvesting photoanode materials with single component and/or morphology (such as, particles, spheres, wires, sheets) is still limited by drawbacks such as insufficient electron–hole separation and/or light-trapping. Herein, we introduce a universal method to prepare hierarchical assembly of macroporous material–nanowire coated homogenous or heterogeneous metal oxide composite electrodes (TiO2–TiO2, SnO2–TiO2, and Zn2SnO4–TiO2; homogenous refers to a material in which the nanowire and the macroporous material have the same composition, i.e. both are TiO2. Heterogeneous refers to a material in which the nanowires and the macroporous material have different compositions). The dye-sensitized solar cell based on a TiO2-macroporous material–TiO2-nanowire homogenous composition electrode shows an impressive conversion efficiency of 9.51 %, which is much higher than that of pure macroporous material-based photoelectrodes to date.