The transparent electrode based on silver nanowire (AgNW) networks is one promising alternative of indium tin oxide film in particular for advanced flexible and printable electronics. However, the widespread application of AgNW electrode is hindered by its poor long-term reliability. Although the reliability can be improved by applying traditional overcoating layer or the core-shell structure, the transmittance or conductivity is inevitably undermined. In this paper, a novel patterned barrier of photoresist in situ assembled on the nanowire surface realized the reliability enhancement by simply employing AgNWs themselves as the mask in the photolithography process. The patterned barrier selectively covered the nanowires, while keeping the high transmittance and conductivity unchanged and improving the adhesion of AgNW networks on substrate. After 720 h storage in 85 °C/85% relative humidity (RH) environment, the resistance of electrode with patterned barrier only increased by 0.72 times. This study proposes a new way, i.e., the in situ patterned barrier containing light-sensitive substance, to selectively protect AgNW networks, which can be expanded to various metallic networks including nanowires, nanorods, nanocables, electrospun nanofibers, and so on.