The answer to 'when to replace GFCI outlet' is that GFCI (ground fault circuit interrupter) outlets should be replaced every 5-10 years, or if they fail to trip when tested. GFCIs are designed to protect against electrical shocks and prevent serious injuries or electrocution. Over time, the internal components can wear out, reducing their effectiveness.
It's important to test GFCI outlets monthly by pressing the 'test' button and ensuring the outlet trips and power is cut off. If the GFCI fails to trip, or if you notice any damage or signs of wear, it's time to replace the outlet. Replacing a GFCI is a relatively simple DIY project, but if you're not comfortable doing it yourself, it's best to hire a licensed electrician to ensure it's done safely and up to code.