Use WordPress for long enough and you’ll eventually run into the problem of stripping WordPress shortcodes, after having been left with a jumble of shortcodes mixed in with otherwise good content that needs to transfer over to a new site or redesign.
The typical culprit of this perverse frankenstein shortcode spaghetti is a what-you-see-is-what-you-get (ie. WYSIWYG) page builder like Divi or Visual Composer. The good news is, there’s a quick fix to remove or strip shortcodes from WordPress content, but the bad news is you’ll have to do it one post at a time (at least for now)
A quick and dirty way to strip WordPress shortcodes from posts and pages
Here’s a quick tool that will do it in one shot for you. You take the spaghetti code that your page builder vomited out, and click ‘STRIP SHORTCODES’.
Boom! Done like dinner. With this rudimentary tool and a few hours of hard work, you can churn through a handful of pages and another hundred posts, cleaning up the shortcodes across the whole site. For us, this tool was enough but if there are other people out there needing this stuff for their WordPress development, I could throw together a small WordPress plugin that cleans all pages and posts.
For what it’s worth, the tool is basic. It’s a quick and dirty fix to your shortcode spaghetti. You’ll certainly have to do some formatting to get your paragraphs back, because hey… you can’t polish a turd. Other than that, it gets the job done quick and easy.
How did the shortcodes get there in the first place?
Typically, when you see shortcodes in WordPress, it’s because you’ve switched away from one of the popular page builder plugins like Divi… or (worse yet*)… Visual Composer.
If you’d like to avoid this in the future, a ton of people have fallen in love with Beaver Builder, saying it feels lighter and more responsive. Another huge benefit that would otherwise go unnoticed is that it’s built with developers in mind: when your website needs customizations beyond what Beaver Builder provides out of the box, the customizations – and being able to seamlessly integrate back into Beaver Builder – is a huge benefit, which saves you money in developer time spent ripping their hair out.
* Why’s Visual Composer so bad? Check out this list of reasons on Reddit.