JayWood / Jw Wpcli Shortcode Scraper
Licence: gpl-3.0
A WP-CLI script to scrape all blog posts for shortcodes ( registered or not ) and provides you a report after complete with CSV capability.
Stars: ✭ 45
WP CLI Shortcode Scraper
This is a shortcode scraper with multisite compatability. The scraper will walk over any site you specify looking for shortcodes. All found shortcodes in posts will be put together for a report, which is output at the end of the operation.
Pull requests are always welcome
Screenshots
( showing the output in console )
( showing the resulting CSV output )
Usage
Installation - Composer
composer require jaywood/jw-shortcode-scraper
If you happen to use the sweet Composer Installers library, this CLI script is
marked as a wp-cli-package
for ease of use later.
Installation - Manual
- Download or clone the repository to
wp-content/mu-plugins/jw-wpcli-shortcode-scraper/
( Name is up to you ) - Create a new file in
wp-content/mu-plugins
call it whatever you want, I useinit.php
- Require the file like so:
<?php
if ( defined( 'WP_CLI' ) && WP_CLI ) {
require_once 'jw-wpcli-shortcode-scraper/jw-shortcode-scraper.php';
}
Now since your init.php
file is in wp-content/mu-plugins
it will always load.
Command Syntax
wp jw-shortcode-scraper scrape [--export] [--site=<slug>]
-
export
- Exports to a csv file, if possible, relative to the current directory. -
site
- Use any site in a multi-site environment, like if you have a sub-site calledfavorite-dogs
it would be--site=favorite-dogs
( A wp-cli plugin by Jay Wood )
Note that the project description data, including the texts, logos, images, and/or trademarks,
for each open source project belongs to its rightful owner.
If you wish to add or remove any projects, please contact us at [email protected].