SlideShare a Scribd company logo
WordPress & 
the command line 
Kelly Dwan 
@ryelle 
NERD Summit • Sept 2014
About Me 
WordPress Developer 
Core Contributor 
Boston WordPress Organizer
“Why should I use the command line, when 
WordPress already has such a fantastic UI?”
• Already included in VVV, VIP Quickstart 
https://github.com/Varying-Vagrant-Vagrants/VVV/ 
https://github.com/Automattic/vip-quickstart 
• Most major hosts include it: DreamHost, Media 
Temple, BlueHost, SiteGround, 1&1… 
• Installation: 
http://wp-cli.org/#install
Basic Commands
wp command subcommand <argument> —flag
• wp core version 
• wp core update 
• wp plugin list 
• wp plugin install <name> [--activate] 
• wp theme list 
• wp theme activate <name>
• wp core download 
• wp core config 
• wp core install / multisite-install 
• wp core multisite-convert
wp help 
wp help <command> 
wp help <command> <subcommand>
Content 
Management
• wp post create 
• wp post delete 
• wp post url 
• wp post meta list 
• wp post meta update
• wp comment approve 
• wp comment delete $(wp comment list -- 
status=spam --format=ids)
• wp media import
• wp term create 
• wp term generate 
• wp term list
Tools
• wp export [—skip_comments] 
• wp import 
• wp media regenerate
Advanced 
Management
• wp user create 
• wp user import-csv 
• wp user remove-cap 
• wp role list 
• wp cap list
• wp cron test 
• wp cron schedule list 
• wp cron event list 
• wp cron event run
• wp rewrite list 
• wp rewrite flush 
• wp rewrite structure
Custom 
Commands
“Adding commands to your plugin is great for 
encouraging good API design, collaborating 
amidst a changing data structure, efficiency, and 
better debugging.” 
–Matt Wiebe, Why You Should Develop Plugins With wp-cli
• Jetpack module control 
• wp jetpack module list 
• wp jetpack module activate 
• BackUpWordPress 
• wp backup [lots of options]
how to write your own
if ( defined('WP_CLI') && WP_CLI ) { 
include __DIR__ . '/my-command.php'; 
}
class Example_Command extends WP_CLI_Command { 
/** 
* Prints a greeting. 
* @synopsis <name> 
*/ 
function hello( $args, $assoc_args ) { 
list( $name ) = $args; 
! 
// Print a success message 
WP_CLI::success( "Hello, $name!" ); 
} 
} 
! 
WP_CLI::add_command( 'example', 'Example_Command' );
class Example_Command extends WP_CLI_Command { 
/** 
* Prints a greeting. 
* @synopsis <name> [<last-name>] 
*/ 
function hello( $args, $assoc_args ) { 
list( $name ) = $args; 
! 
// Print a success message 
WP_CLI::success( "Hello, $name!" ); 
} 
} 
! 
WP_CLI::add_command( 'example', 'Example_Command' );
• WP CLI Commands Cookbook walks through this 
in more detail.
Automated 
Migrations
From WordPress
• wp export [on source site] 
• wp import [on destination] 
• wp search-replace <old> <new> 
—skip-columns=guid —dry-run
From Other CMSs
• Importing (any!) Content with WP-CLI
• https://github.com/wp-cli/wp-cli/wiki/External- 
Resources 
• http://redradar.net/nerds-wp-cli

More Related Content

PDF
Working in Harmony: Manchester - Optimize development and content workflows
PDF
The Themer's Guide to WP-CLI
PDF
Command Line WordPress with WP-CLI - WordPress Perth User Group
PDF
Command Line WordPress with WP-CLI
PDF
Working in harmony
PDF
Server Check.in case study - Drupal and Node.js
PPT
Wp cli-wcbalt
PPT
Working in Harmony: Manchester - Optimize development and content workflows
The Themer's Guide to WP-CLI
Command Line WordPress with WP-CLI - WordPress Perth User Group
Command Line WordPress with WP-CLI
Working in harmony
Server Check.in case study - Drupal and Node.js
Wp cli-wcbalt

What's hot (20)

PDF
Node.js to the rescue
PDF
Internationalizing The New York Times
PPTX
Best Practices for creating WP REST API by Galkin Nikita
PPT
Developing Plugins For WordPress
PPTX
The Next Step in Responsive - RESS
PPT
Creating Local WordPress Installs
PDF
WordPress as the Backbone(.js)
PDF
Isomorphic WordPress Applications with NodeifyWP
PDF
Speeding up your WordPress Site - WordCamp Toronto 2015
PPTX
Building an API in Node with HapiJS
PPTX
An Introduction to hapi.js
PDF
Using hapi plugins to version your API (hapiDays 2014)
KEY
Advanced WordPress Development Environments
PPTX
Piecing Together the WordPress Puzzle
PPTX
Best Practices for WordPress in Enterprise
PPTX
Week1 Introduction
PPTX
Introdcution to Adobe CQ
PDF
WP-CLI - A Good Friend of Developer
PDF
Best Practices for WordPress
PDF
Angular2 ecosystem
Node.js to the rescue
Internationalizing The New York Times
Best Practices for creating WP REST API by Galkin Nikita
Developing Plugins For WordPress
The Next Step in Responsive - RESS
Creating Local WordPress Installs
WordPress as the Backbone(.js)
Isomorphic WordPress Applications with NodeifyWP
Speeding up your WordPress Site - WordCamp Toronto 2015
Building an API in Node with HapiJS
An Introduction to hapi.js
Using hapi plugins to version your API (hapiDays 2014)
Advanced WordPress Development Environments
Piecing Together the WordPress Puzzle
Best Practices for WordPress in Enterprise
Week1 Introduction
Introdcution to Adobe CQ
WP-CLI - A Good Friend of Developer
Best Practices for WordPress
Angular2 ecosystem
Ad

Similar to WordPress and The Command Line (20)

PPTX
Saving Time with WP-CLI
PPTX
Take Command of WordPress With WP-CLI
PDF
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
PPTX
Worcamp2012 make a wordpress multisite in 20mins
PPTX
Take Command of WordPress With WP-CLI
PPTX
WP-CLI - A Good Friend of Developer
PDF
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
PPTX
Take Command of WordPress With WP-CLI
PDF
The WP Engine Developer Experience. Increased agility, improved efficiency.
PPTX
Take Command of WordPress With WP-CLI at WordCamp Long Beach
PDF
WordPress Acceptance Testing, Solved!
PPTX
WordPress CLI in-depth
ODP
Administer WordPress with WP-CLI
PPTX
Presentation to SAIT Students - Dec 2013
PDF
Creating Your First WordPress Plugin
PDF
Developers, Be a Bada$$ with WP-CLI
PDF
Intro to WordPress Plugin Development
PDF
The WordPress Way
PPTX
Word Press As A Cms
PPTX
Advanced WordPress Tooling: By InstaWP.com
Saving Time with WP-CLI
Take Command of WordPress With WP-CLI
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Worcamp2012 make a wordpress multisite in 20mins
Take Command of WordPress With WP-CLI
WP-CLI - A Good Friend of Developer
Chandra Prakash Thapa: Make a WordPress Multisite in 20 mins
Take Command of WordPress With WP-CLI
The WP Engine Developer Experience. Increased agility, improved efficiency.
Take Command of WordPress With WP-CLI at WordCamp Long Beach
WordPress Acceptance Testing, Solved!
WordPress CLI in-depth
Administer WordPress with WP-CLI
Presentation to SAIT Students - Dec 2013
Creating Your First WordPress Plugin
Developers, Be a Bada$$ with WP-CLI
Intro to WordPress Plugin Development
The WordPress Way
Word Press As A Cms
Advanced WordPress Tooling: By InstaWP.com
Ad

Recently uploaded (20)

PDF
NewMind AI Monthly Chronicles - July 2025
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
Big Data Technologies - Introduction.pptx
PDF
Chapter 3 Spatial Domain Image Processing.pdf
PDF
NewMind AI Weekly Chronicles - August'25 Week I
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
Review of recent advances in non-invasive hemoglobin estimation
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PDF
Empathic Computing: Creating Shared Understanding
PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PDF
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
PDF
Reach Out and Touch Someone: Haptics and Empathic Computing
PDF
Electronic commerce courselecture one. Pdf
PDF
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
PPTX
20250228 LYD VKU AI Blended-Learning.pptx
PDF
KodekX | Application Modernization Development
PDF
Mobile App Security Testing_ A Comprehensive Guide.pdf
PPTX
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication
NewMind AI Monthly Chronicles - July 2025
Diabetes mellitus diagnosis method based random forest with bat algorithm
Big Data Technologies - Introduction.pptx
Chapter 3 Spatial Domain Image Processing.pdf
NewMind AI Weekly Chronicles - August'25 Week I
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Advanced methodologies resolving dimensionality complications for autism neur...
Review of recent advances in non-invasive hemoglobin estimation
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Empathic Computing: Creating Shared Understanding
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
Peak of Data & AI Encore- AI for Metadata and Smarter Workflows
Reach Out and Touch Someone: Haptics and Empathic Computing
Electronic commerce courselecture one. Pdf
Shreyas Phanse Resume: Experienced Backend Engineer | Java • Spring Boot • Ka...
20250228 LYD VKU AI Blended-Learning.pptx
KodekX | Application Modernization Development
Mobile App Security Testing_ A Comprehensive Guide.pdf
PA Analog/Digital System: The Backbone of Modern Surveillance and Communication

WordPress and The Command Line

  • 1. WordPress & the command line Kelly Dwan @ryelle NERD Summit • Sept 2014
  • 2. About Me WordPress Developer Core Contributor Boston WordPress Organizer
  • 3. “Why should I use the command line, when WordPress already has such a fantastic UI?”
  • 4. • Already included in VVV, VIP Quickstart https://github.com/Varying-Vagrant-Vagrants/VVV/ https://github.com/Automattic/vip-quickstart • Most major hosts include it: DreamHost, Media Temple, BlueHost, SiteGround, 1&1… • Installation: http://wp-cli.org/#install
  • 6. wp command subcommand <argument> —flag
  • 7. • wp core version • wp core update • wp plugin list • wp plugin install <name> [--activate] • wp theme list • wp theme activate <name>
  • 8. • wp core download • wp core config • wp core install / multisite-install • wp core multisite-convert
  • 9. wp help wp help <command> wp help <command> <subcommand>
  • 11. • wp post create • wp post delete • wp post url • wp post meta list • wp post meta update
  • 12. • wp comment approve • wp comment delete $(wp comment list -- status=spam --format=ids)
  • 13. • wp media import
  • 14. • wp term create • wp term generate • wp term list
  • 15. Tools
  • 16. • wp export [—skip_comments] • wp import • wp media regenerate
  • 18. • wp user create • wp user import-csv • wp user remove-cap • wp role list • wp cap list
  • 19. • wp cron test • wp cron schedule list • wp cron event list • wp cron event run
  • 20. • wp rewrite list • wp rewrite flush • wp rewrite structure
  • 22. “Adding commands to your plugin is great for encouraging good API design, collaborating amidst a changing data structure, efficiency, and better debugging.” –Matt Wiebe, Why You Should Develop Plugins With wp-cli
  • 23. • Jetpack module control • wp jetpack module list • wp jetpack module activate • BackUpWordPress • wp backup [lots of options]
  • 24. how to write your own
  • 25. if ( defined('WP_CLI') && WP_CLI ) { include __DIR__ . '/my-command.php'; }
  • 26. class Example_Command extends WP_CLI_Command { /** * Prints a greeting. * @synopsis <name> */ function hello( $args, $assoc_args ) { list( $name ) = $args; ! // Print a success message WP_CLI::success( "Hello, $name!" ); } } ! WP_CLI::add_command( 'example', 'Example_Command' );
  • 27. class Example_Command extends WP_CLI_Command { /** * Prints a greeting. * @synopsis <name> [<last-name>] */ function hello( $args, $assoc_args ) { list( $name ) = $args; ! // Print a success message WP_CLI::success( "Hello, $name!" ); } } ! WP_CLI::add_command( 'example', 'Example_Command' );
  • 28. • WP CLI Commands Cookbook walks through this in more detail.
  • 31. • wp export [on source site] • wp import [on destination] • wp search-replace <old> <new> —skip-columns=guid —dry-run
  • 33. • Importing (any!) Content with WP-CLI
  • 34. • https://github.com/wp-cli/wp-cli/wiki/External- Resources • http://redradar.net/nerds-wp-cli