The dynamic regulation of pH via an external stimulus is an attractive technique to gate chemical transformations. Applying photons of different energy, we preferentially address either a photoacid or a photobase donor in the same solutions and thus, present a technique to regulate the pH of a solution through light pulses.