Photoelectrochemical oxidation of water presents a pathway for sustainable production of hydrogen peroxide (H2O2). Two-electron water oxidation toward H2O2, however, competes with the popular four-electron process to form oxygen and one-electron water oxidation to form OH radical. To date, bismuth vanadate (BiVO4) has been shown to exhibit promising selectivity toward H2O2, especially under illumination, but it suffers from high overpotential and notoriously poor stability. Herein, using density functional theory calculations, we predict that doping BiVO4 with optimal concentrations of gadolinium (Gd) not only enhances its activity for H2O2 production but also improves its stability. Experimentally, we demonstrate that intermediate amounts of Gd doping (6-12%) reduce the onset potential of BiVO4 for H2O2 production by ∼110 mV while achieving a Faradaic efficiency of ∼99.5% under illumination and prolonging the catalytic lifetime by more than a factor of 20 at 2.0 V vs RHE under illumination.