The efficient removal of gas bubbles in (photo)electrochemical gas evolution reactions is an important but underexplored issue. Conventionally, researchers have attempted to impart bubble-repellent properties (so-called superaerophobicity) to electrodes by controlling their microstructures. However, conventional approaches have limitations, as they are material specific, difficult to scale up, possibly detrimental to the electrodes' catalytic activity and stability, and incompatible with photoelectrochemical applications. To address these issues, we report a simple strategy for the realization of superaerophobic (photo)electrodes via the deposition of hydrogels on a desired electrode surface. For a proof-of-concept demonstration, we deposited a transparent hydrogel assembled from M13 virus onto (photo)electrodes for a hydrogen evolution reaction. The hydrogel overlayer facilitated the elimination of hydrogen bubbles and substantially improved the (photo)electrodes' performances by maintaining high catalytic activity and minimizing the concentration overpotential. This study can contribute to the practical application of various types of (photo)electrochemical gas evolution reactions.