3 Reasons You Should Never Run an Extension Cord Through a Wall
It violates electrical code The National Electrical Code (NEC 400.8) explicitly prohibits using extension cords as permanent wiring or running them through walls, ceilings, or floors.
It creates a serious fire hazard Extension cords are not rated for enclosed spaces. Without proper ventilation, they can overheat, short circuit, or ignite nearby materials.
There is a safe alternative Install a junction box with proper NM-B (Romex) cable and a weatherproof fixture instead. This costs about $30 in parts and is the only code-compliant way to get power through a wall. If you are not comfortable with basic electrical work, hire an electrician.