As of this post – and this version – the plugin only works on post
and page
post types.
Obviously, this muddies the content for readers by leaving artifacts of code that’s no longer running. So rather than query the database for shortcodes that were orphaned in my content or just remove a single plugin’s shortcodes, it seemed easier to do something else: Automatically remove empty or inactive shortcodes from my WordPress content while preserving the original database entries.
It worked well enough for a little while. Then time passed.
- I removed all of my plugins from the WordPress plugin repository,
- I focused on a number of different things both professionally and personally,
- And though I let this plugin remain on GitHub (as opposed to archiving it), I stopped maintaining it.
And that’s what this plugin does. Specifically, it intercepts the content before it’s rendered, removes the shortcodes, then passes the rest of the data back to the main process to render the content.
Remove Empty Shortcodes, Again

During that time (and for one reason or another):
If a user installs a plugin that uses shortcodes and then deactivates the plugin, the shortcode will still render in the content of the post.
You can read all about the details for the plugin (including the FAQ) on both GitHub or the Plugin Repository but here’s the gist of information relevant to this post:
But since this is one of those things that I’m using on a site with over a decade and a half of content, it may be useful for someone else, as well.

The plugin checks your content for shortcodes when pages are displayed. If it finds shortcodes that:
In 2019, I wrote a WordPress plugin that’s primary feature was to prevent unused shortcodes from rendering in the content whenever a page was loaded.
It’s been a long time since I’ve released a plugin in the WordPress Plugin Repository (regardless of how large or small) let alone bothered writing about one on this site.
How It Works
Just recently, I came across the problem of rendering orphaned shortcodes again and I noticed someone had left an issue in GitHub. So I decided to rewrite the plugin, tag a release on GitHub, and release it into the WordPress plugin repository.
- Don’t produce any output
- Aren’t registered with WordPress
- Are empty or inactive
When I first wrote this plugin, I had stopped using Restrict Content Pro but the shortcodes were still littered throughout various posts in my archive. And this exposed a larger problem with shortcodes as a whole:
Use Cases
- Clean up content after removing plugins that used shortcodes
- Remove inactive shortcodes without editing posts manually
- Maintain clean content for readers and search engines
- Preserve original content in case you reinstall removed plugins
Conclusion
And yes, there additional things that thing plugin could do and maybe it will but that will largely depend on adoption or my own needs or both.
This ensures that if you ever reactivate the plugin, the shortcode still exists and will work as intended.
Then it removes the shortcodes from the content before rendering it in the browser.