Postsynthesis thermal treatments are key to promote crystallinity and reduce the defect density in solution-processed nanomaterials. In particular, the annealing atmosphere strongly influences the functional properties of ZnO nanowires (NWs) and specifically their performance as photoanodes in dye-sensitized solar cells (DSCs). We prepared vertically aligned ZnO NWs by a low-cost, high-yield, and up-scalable hydrothermal method and studied the effect of the postannealing atmosphere on their optoelectronic properties and on their performance as electrodes in DSCs. When annealing ZnO NWs under argon, instead of air, significantly higher photoluminescence (PL) UV emission and relatively lower defects-related visible PL emission were obtained. At the same time, Ar-annealing rendered ZnO NWs with higher electrical conductivities, as observed from single NW measurements using conductive-atomic force microscopy. Furthermore, DSCs based on ZnO NWs annealed in argon were characterized by 50% higher photocurrents than those obtained from air-annealed ZnO. As a result 30% efficiency increases were systematically obtained when using argon as the annealing atmosphere. These results are discussed within the framework of a multiple trapping model for transport and charge transfer, taking into account differences in the defect concentration introduced during the annealing.