Comprehensive WP-CLI Learning Curriculum
Module 1: Introduction to WP-CLI
- Topic 1.1: What is WP-CLI?
- Definition, purpose, advantages over wp-admin
- Requirements (PHP, WordPress, shell access)
- Topic 1.2: Installation & Setup
- Installing via Phar, Composer, Homebrew, package managers
- Global vs per-user installation
- Verifying with
wp --info - Topic 1.3: Basic Command Syntax
- General syntax:
wp [command] [subcommand] [options] [ARGS] - Command hierarchy (command → subcommand → options → arguments)
- Short vs long flags (
-hvs--help) - Global parameters:
--path,--url,--user,--skip-plugins,--skip-themes,--quiet,--debug
Module 2: Core WordPress Management
- Topic 2.1: Core Commands
wp core download(all flags:--locale,--version,--force)wp core install(syntax, operators:--url,--title,--admin_user,--admin_password,--admin_email)wp core update,wp core update-dbwp core verify-checksums,wp core version- Topic 2.2: Configuration Files
wp config create(all operators:--dbname,--dbuser,--dbpass,--dbhost,--dbprefix)wp config list,wp config set,wp config delete,wp config shuffle-salts
Module 3: Plugin Management
- Topic 3.1: Plugin Installation & Updates
wp plugin install SLUG_OR_ZIP_OR_URL(operators:--activate,--force,--version)wp plugin update PLUGIN_OR_ALLwp plugin uninstall,wp plugin delete- Topic 3.2: Plugin Status & Activation
wp plugin activate,wp plugin deactivatewp plugin status(columns, formatting flags)- Topic 3.3: Edge Cases
- Installing remote plugins via
.zipor Git repo - Bulk activation/deactivation (
xargs,--all)
Module 4: Theme Management
- Topic 4.1: Installation & Updates
wp theme install SLUG_OR_ZIP_OR_URL(operators:--activate,--version)wp theme update THEME_OR_ALL- Topic 4.2: Theme Switching & Info
wp theme activate,wp theme status,wp theme list- Topic 4.3: Customization Files
wp theme mod get,wp theme mod set,wp theme mod remove
Module 5: Database Management
- Topic 5.1: Database Operations
wp db create,wp db drop,wp db resetwp db export,wp db import,wp db query(syntax like MySQL CLI)- Topic 5.2: Search & Replace
wp search-replace SEARCH REPLACE- Operators:
--dry-run,--network,--skip-columns,--precise - Topic 5.3: Optimize & Repair
wp db optimize,wp db repair
Module 6: User Management
- Topic 6.1: Creating & Managing Users
wp user create LOGIN EMAIL(operators:--role,--user_pass,--display_name)wp user update,wp user delete,wp user set-role- Topic 6.2: Listing & Authentication
wp user list(columns: ID, login, email, role)wp user metasubcommands (add, get, delete, update)
Module 7: Content Management
- Topic 7.1: Posts
wp post create,wp post update,wp post delete- Arguments:
--post_type,--post_status,--post_author - Bulk imports with JSON/CSV
- Topic 7.2: Taxonomies
wp term create,wp term list,wp term delete- Operators:
--slug,--description,--parent - Topic 7.3: Comments
wp comment create,wp comment approve,wp comment spam,wp comment delete
Module 8: Media Management
- Topic 8.1: Upload & Attachments
wp media import FILE_OR_URL(operators:--title,--alt,--caption,--featured_image)- Topic 8.2: Regenerating Thumbnails
wp media regenerate(operators:--only-missing,--yes)
Module 9: Multisite Management
- Topic 9.1: Network Setup
wp core multisite-convert,wp core multisite-install- Topic 9.2: Site Management
wp site create,wp site list,wp site delete- Topic 9.3: Network User & Plugin Management
wp super-admin,wp plugin --network,wp theme --network
Module 10: Advanced Tools
- Topic 10.1: Cron Jobs
wp cron event list,wp cron event run,wp cron schedule- Topic 10.2: Transients & Cache
wp transient get,wp transient set,wp transient deletewp cache flush,wp cache get,wp cache set- Topic 10.3: REST API & Scaffold
wp scaffold plugin,wp scaffold theme,wp scaffold post-type,wp scaffold taxonomywp restsubcommands
Module 11: Security & Maintenance
- Topic 11.1: Checksum Verification
wp core verify-checksumswp plugin verify-checksums,wp theme verify-checksums- Topic 11.2: Site Health & Debugging
wp doctor,wp doctor check--debug,--skip-plugins,--skip-themesadvanced usage
Module 12: Automation & Scripting
- Topic 12.1: Chaining Commands
- Using
&&, pipes, andxargswith WP-CLI - Topic 12.2: Aliases & Config Files
~/.wp-cli/config.ymlglobal config- Defining aliases (
@prod,@staging) - Topic 12.3: Remote & SSH Execution
wp @prod plugin update --all- Using
wp --ssh=[user@host]
Module 13: Extending WP-CLI
- Topic 13.1: Custom Commands
- Structure of a custom WP-CLI command
- Registering with
WP_CLI::add_command() - Topic 13.2: Best Practices
- Namespacing commands
- Handling arguments & errors gracefully
Module 14: Special Cases & Edge Syntax
- Aliasing multiple sites with wildcard operators
- Dry-run vs force execution (
--dry-run,--force,--yes) - Using
--format(table,json,csv,yaml,count) - Edge case handling for large databases & search-replace precision
Module 15: Mastery & Real-World Scenarios
- Automating daily maintenance with WP-CLI
- Backup & migration workflows (
db export/import,search-replace) - Scaling for agencies: managing 100+ sites with aliases
- CI/CD pipelines integrating WP-CLI
This curriculum covers command syntax, workflows, troubleshooting, and advanced operations in a progressive sequence from onboarding to production-grade automation.
Next Steps
- Start with What is WP-CLI? if you are new to CLI-based WordPress operations.
- Continue to Installation & Setup and Basic Command Syntax for hands-on readiness.