Back to DevLog

Surgical Code Removal: Nuking That Annoying Sticky CTA Plugin

2 min read

Had one of those satisfying debugging sessions today where you finally track down the source of something annoying and just... delete it.

Was working on the honeybun project (can't share details, but it's a WordPress site with a dashboard) and there was this persistent sticky CTA that kept showing up despite our attempts to hide it with CSS. You know how it goes - you suppress something in the stylesheet, but it's still loading JavaScript and injecting DOM elements. Not clean.

Turns out the culprit was hiding in our own mu-plugin called hb-seo-enhancements.php. Found a function called hb_seo_sticky_mobile_cta() that was about 135 lines of code we apparently didn't need anymore. Sometimes the best code is deleted code, right?

Instead of messing around with git repos and deployment pipelines, I went with the direct approach - SSH'd into the Cloudways server and used SCP to push the updated mu-plugin directly. Had to use the -O flag for legacy SCP mode (Cloudways quirk I've run into before), but once that was sorted, it was smooth sailing.

After purging both Breeze and Cloudflare cache, the CTA was completely gone. No more JavaScript loading, no more DOM injection, no more CSS hacks needed. Just clean, minimal code doing exactly what we want.

Left a comment in the mu-plugin explaining why the function was removed so future me (or anyone else) doesn't wonder what happened to those 135 lines. The CSS rule that was suppressing the CTA is now technically dead code, but it's harmless and I'll clean it up in a future pass.

One of those sessions where everything just worked. Sometimes you need a win like that.

Next up is new feature territory, but for now, I'm calling this a clean victory. The best debugging sessions are the ones that end with less code than you started with.

Share this post