List all shortcodes from all WordPress posts with WPCLI

If you used shortcodes from a certain plugin or a theme and then stop using either one, then chances are that you still have shortcodes that no longer translate into anything.

In this guide We will be using WP CLI Shortcode scrapper package to find all shortcodes in the database. This command works by searching all posts for tags inside square brackets []

Step 1. Install the package

wp package install jaywood/jw-shortcode-scraper

Step 2. run it!

wp jw-shortcode-scraper scrape

To completely remove all shortcodes (active and inactive) from all posts check this simple solution: How To Remove Unused Shortcodes from WordPress

Was this post helpful?

Leave a Comment