🔬 Generalized🟡 Intermediate⏱ 30 Minutes✓ Observation from Experience
You track down the bug. You fix the code. You redeploy, confident this is over. You reload the site — and the feature is still broken, exactly as before, like nothing happened at all. Before you start doubting your own fix, there’s a specific, boring explanation worth ruling out first: the code was never the thing standing between you and a working feature. Something else quietly turned the whole thing off, and fixing the code doesn’t turn it back on.
What’s actually happening If you’re running custom PHP through a code-snippet plugin (WPCode, and others like it work the same way), there’s a safety net built in: if a snippet throws a fatal error when WordPress tries to load it, the plugin catches that and automatically flips the snippet to inactive — specifically so one broken snippet can’t take your entire site down with it. That’s a genuinely good feature. The part that catches people off guard is what happens next: once that snippet’s been auto-deactivated, uploading a corrected version doesn’t reactivate it. The toggle stays off. WordPress isn’t watching your file for changes and deciding “oh, this looks fine now” — it just remembers “this one caused a problem,” and it stays off until a human turns it back on. So you can fix the actual bug perfectly, paste in flawless code, and the feature stays dead — because the code was never the reason it wasn’t running. The toggle was.
How to tell the difference Open the snippet plugin’s dashboard and look at the specific snippet’s status — not just whether the code looks right, whether it’s actually marked active. If it says inactive and you don’t remember turning it off yourself, that’s the tell. Something (usually a fatal error on a previous version of the file) shut it off automatically, and no amount of code editing will change that status — only flipping the switch will.
The fix Fix the actual underlying bug first. If you skip this and just re-enable a broken snippet, you’re right back where you started, potentially taking the site down again. Once you’re confident the fix is correct, go into the snippet plugin and manually toggle the snippet back to active. Reload the page and confirm the feature is actually back — don’t just trust that flipping the switch means it worked, since that’s exactly the kind of assumption that started this whole detour.
How to avoid it next time You can’t really prevent the auto-deactivation itself — it’s doing its job, protecting your site from a bad snippet. What you can build into your own habit: whenever a custom snippet “stops working” for no obvious reason, check its active/inactive status before you start debugging the code. It takes ten seconds, and it saves you from staring at correct code wondering why it isn’t running.