Nanostructured ZnO films are promising photoanode materials in photoelectrochemical water splitting. While such ZnO photoanodes have achieved high activity and good light conversion efficiency in the UV spectral region, their application in water splitting devices has been hampered by the susceptibility of ZnO towards photocorrosion in aqueous electrolytes. We report a systematic investigation aimed at optimising the electrolyte solution to improve the long-term stability of ZnO photoanodes. A stability diagram, based on the band edge positions of ZnO and the pH-dependent photodegradation potentials of ZnO (relative to the decomposition of water), indicates that the optimum pH operating conditions for ZnO photoanodes lie between pH 9-12.5. To verify this prediction experimentally, the activity and long-term stability of uniform screen-printed nano-ZnO films was tested in a wide range of buffered and non-buffered electrolytes (pH 6-13.5). The ZnO films were more active in buffered, than in non-buffered electrolytes, and the highest activities were observed close to the pKa of the phosphate and borate buffers used. Under zero applied potential, these screen-printed films achieved the highest reported photocurrents to date (0.42 mA cm(-2) at pH 6 and 0.67 mA cm(-2) at pH 10.5) for any pristine or modified ZnO-based water oxidation catalyst. The films were subjected to 12 h of controlled potential electrolysis, in selected electrolytes, under AM 1.5G simulated sunlight. The results are in good agreement with calculations based on thermodynamic data for ZnO. Films tested at pH 6 and 7 (representing typically used operating conditions) degraded rapidly, whereas they exhibited the highest stability when tested in a pH 10.5 borate buffer. In this case, 75% of the initial photoactivity was preserved after 12 hours, indicating that the lifetime of the electrode could be increased by over an order of magnitude compared to standard testing conditions.