The limited material removal rate of conventional chemical mechanical polishing (CMP) significantly hinders the fabrication efficiency and surface quality, thereby preventing the development of gallium nitride (GaN)-based devices. Moreover, the incorporation of photoelectrochemistry in CMP has garnered increasing attention because of its potential to enhance the quality and efficiency of the GaN process. However, a considerable gap still exists in the comprehensive understanding of the specific photoelectrochemical (PEC) behavior of GaN. Here, we report the influence of the electrolyte on the PEC etching of GaN. Various acids and bases were tested, with their pH being carefully adjusted. The concentrations of the cations and anions were also examined. The results showed that photocorrosion/photoetching was more pronounced in sulfuric acid, phosphoric acid, and nitric acid environments than in alkaline environments, but it was less pronounced in hydrochloric acid. Furthermore, the effects of pH and anion concentration on photoetching were investigated, and the results revealed that photoetching in acidic environments weakened with increasing pH levels and diminished with increasing sulfate concentration. The underlying reasons contributing to this observation were explored. These findings provide ideas for improving the photoetching efficiency of GaN, thereby enriching the photoelectrochemical mechanical polishing (PECMP) technology of GaN.