WP-CLI » List all shortcodes from all WordPress posts with WPCLI

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
image 43 - List all shortcodes from all WordPress posts with WPCLI

Step 2. run it!

wp jw-shortcode-scraper scrape
image 44 - List all shortcodes from all WordPress posts with WPCLI

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

See also  Use Regex with WP CLI to 🔎 Search & Replace in Database

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended