SlideShare a Scribd company logo
1 of 36
Download to read offline
WP-CLI: Save Time by
Managing WordPress
from the Command Line
WordCamp Tampa 2015	

!
Shawn Hooper

Chief Technology Officer,Actionable Books	

@shawnhooper - shawnhooper.ca
• I’m Shawn Hooper, a web application
developer from Ottawa.
• I’ve been working in WordPress since
2009.
• I love the working from the command
prompt, reminds me of my days running
a BBS (in the days before the Internet)
Hi!
@shawnhooper - shawnhooper.ca
Command Line?!
@shawnhooper - shawnhooper.ca
• A set of command line tools that allows
you to manage WordPress from the
command line.

• http://www.wp-cli.org/
What is WP-CLI ?
@shawnhooper - shawnhooper.ca
• Anyone really, but mostly:
• Developers
• Theme Designers
• Server Administrators
Who is this for?
@shawnhooper - shawnhooper.ca
Don’t Fear The
Command Line
@shawnhooper - shawnhooper.ca
• http://www.wp-cli.org/
• Requires PHP 5.3.2 or later
• Requires WordPress 3.5.2 or later
• A “UNIX-like” environment:
• OSX (Macintosh)
• Linux
• Cygwin (Windows)
What do you need?
@shawnhooper - shawnhooper.ca
• You need to have SSH access to use
WP-CLI. Some shared hosting packages
do not allow SSH access
• PlanetHoster, SiteGround, Pantheon,
BlueHost, GoDaddy, Media Temple,
Windows Azure and more now have
CLI support.
• VPS services like Digital Ocean and
Linode, Atlantic.net are ideal.
Hosts
@shawnhooper - shawnhooper.ca
• Download it:

curl -O https://raw.githubusercontent.com/
wp-cli/builds/gh-pages/phar/wp-cli.phar

• Set permissions: 

chmod +x wp-cli.phar

• Move it somewhere useful:

sudo mv wp-cli.phar /usr/local/bin/wp 

Installing WP-CLI
@shawnhooper - shawnhooper.ca
• Does it work? Type:



wp

Installing WP-CLI
@shawnhooper - shawnhooper.ca
Installing WP-CLI
@shawnhooper - shawnhooper.ca
Congratulations!
(that was the hard part)
@shawnhooper - shawnhooper.ca
Great… It’s installed.
So now what….
@shawnhooper - shawnhooper.ca
wp <command> <sub-command> <params>
Running Commands:
@shawnhooper - shawnhooper.ca
<param> — required
[—param] — optional flag
[—param=<value>] — optional w/ value
Running Commands:
@shawnhooper - shawnhooper.ca
• Check current WordPress version, or
see if there are updates available.
• Do the update!
• Install a brand new site
• Convert an existing site to Multisite!
• Verify core checksums
core
@shawnhooper - shawnhooper.ca
• Let’s try setting up a brand new site on
a development server using:



wp core download

wp core config

wp db create

wp core install --prompt
core
@shawnhooper - shawnhooper.ca
• Install, Delete Plugins
• Activate & Deactivate Plugins
• Update Plugins
• Search the repository for plugins
plugin
@shawnhooper - shawnhooper.ca
• Time savers!



wp plugin update — all



wp plugin deactivate — all
plugin
@shawnhooper - shawnhooper.ca
The “db” command interacts with
the MySQL database.
!
wp db export backup.sql



wp db import backup.sql



wp db cli
db
@shawnhooper - shawnhooper.ca
• Safe Search & Replace, including
serialized arrays!

• Supports --dry-run
search-replace
@shawnhooper - shawnhooper.ca
Generate Test Content !
wp post generate --count=500
post
@shawnhooper - shawnhooper.ca
Create Posts with Random
Content using Any Ipsum Plugin
!
wp plugin install any-ipsum —
activate

wp any-ipsum generate-posts 100
post
@shawnhooper - shawnhooper.ca
Regenerate Thumbnails
!
wp media regenerate —yes
media
@shawnhooper - shawnhooper.ca
Start an underscores theme!
!
wp scaffold _s mytheme
scaffold
@shawnhooper - shawnhooper.ca
… or a child theme
!
wp scaffold child-theme mychild
—parent_theme=twentyfourteen
scaffold
@shawnhooper - shawnhooper.ca
… or a custom post type
!
wp scaffold post-type mycpt —
theme
scaffold
@shawnhooper - shawnhooper.ca
Download & Activate a Theme
from WordPress.org
!
wp theme install simone —activate
theme
@shawnhooper - shawnhooper.ca
wp user generate
wp user import-csv
Create Users
@shawnhooper - shawnhooper.ca
wp term list
wp term create
wp term generate
Taxonomies
@shawnhooper - shawnhooper.ca
Executes PHP code

* after loading the WordPress Core *
eval & eval-file
@shawnhooper - shawnhooper.ca
wp role create
wp role list
wp role exists
!
new: —clone flag on create
role & cap
@shawnhooper - shawnhooper.ca
Launches PHP’s Built-in Web Server
!
wp server
server
@shawnhooper - shawnhooper.ca
Add any functionality you want
that isn’t already included in the
WP-CLI core.
https://github.com/wp-cli/wp-cli/
wiki/List-of-community-commands
Community
Commands
@shawnhooper - shawnhooper.ca
You can either write them as a
plugin, or include it using the

—require parameter

on the command line.
Community
Commands
@shawnhooper - shawnhooper.ca
Thank you!

Slides: www.shawnhooper.ca

E-Mail: shawn@actionablebooks.com

Twitter: @shawnhooper

WordPress Slack: shooper
@shawnhooper - shawnhooper.ca

More Related Content

What's hot

Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your Showcases
Jun Hu
 
Optimizing WordPress - WordPress SF Meetup April 2012
Optimizing WordPress -  WordPress SF Meetup April 2012Optimizing WordPress -  WordPress SF Meetup April 2012
Optimizing WordPress - WordPress SF Meetup April 2012
Ben Metcalfe
 
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Bruce Li
 

What's hot (20)

Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your Showcases
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
 
Optimizing WordPress - WordPress SF Meetup April 2012
Optimizing WordPress -  WordPress SF Meetup April 2012Optimizing WordPress -  WordPress SF Meetup April 2012
Optimizing WordPress - WordPress SF Meetup April 2012
 
Desktop server presentation
Desktop server presentationDesktop server presentation
Desktop server presentation
 
Key learnings from hosting 1000+ WordPress sites
Key learnings from hosting 1000+ WordPress sitesKey learnings from hosting 1000+ WordPress sites
Key learnings from hosting 1000+ WordPress sites
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency Heaven
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLI
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPress
 
Wp cli-wcbalt
Wp cli-wcbaltWp cli-wcbalt
Wp cli-wcbalt
 
Wp cli
Wp cliWp cli
Wp cli
 
Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)
 
WordPress Security & Backup
WordPress Security & Backup WordPress Security & Backup
WordPress Security & Backup
 
Make your life easy with WP-CLI
Make your life easy with WP-CLIMake your life easy with WP-CLI
Make your life easy with WP-CLI
 
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
Make your Rails console AWESOME (Ruby SG meetup 2016-03-29)
 
My Website Can Vote - The Challenges of Maintaining a 20-year-old Website
My Website Can Vote - The Challenges of Maintaining a 20-year-old WebsiteMy Website Can Vote - The Challenges of Maintaining a 20-year-old Website
My Website Can Vote - The Challenges of Maintaining a 20-year-old Website
 
You Got React.js in My PHP
You Got React.js in My PHPYou Got React.js in My PHP
You Got React.js in My PHP
 
Set up dev environment
Set up dev environmentSet up dev environment
Set up dev environment
 
Wordpress installation
Wordpress installationWordpress installation
Wordpress installation
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installs
 
Server Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.jsServer Check.in case study - Drupal and Node.js
Server Check.in case study - Drupal and Node.js
 

Similar to Manage WordPress From the Command Line with WP-CLI

WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
Shawn Hooper
 
Wordpress website development
Wordpress website developmentWordpress website development
Wordpress website development
John Faust
 

Similar to Manage WordPress From the Command Line with WP-CLI (20)

Save Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command LineSave Time by Managing WordPress from the Command Line
Save Time by Managing WordPress from the Command Line
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp Montreal
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015
 
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
Chef Fundamentals Training Series Module 3: Setting up Nodes and Cookbook Aut...
 
Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0Building the next generation of themes with WP Rig 2.0
Building the next generation of themes with WP Rig 2.0
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depth
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For Beginners
 
Wordpress 101 presentation - Canadian Association of Labour Media (CALM)
Wordpress 101 presentation - Canadian Association of Labour Media (CALM)Wordpress 101 presentation - Canadian Association of Labour Media (CALM)
Wordpress 101 presentation - Canadian Association of Labour Media (CALM)
 
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
 
OSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy HawkinsOSDC 2013 | Introduction into Chef by Andy Hawkins
OSDC 2013 | Introduction into Chef by Andy Hawkins
 
Wordpress website development
Wordpress website developmentWordpress website development
Wordpress website development
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen Summit
 
WordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationWordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow Presentation
 
The Environment Restaurant
The Environment RestaurantThe Environment Restaurant
The Environment Restaurant
 
Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...Drupal commerce performance profiling and tunning using loadstorm experiments...
Drupal commerce performance profiling and tunning using loadstorm experiments...
 
Word camp 2013 migration
Word camp 2013 migrationWord camp 2013 migration
Word camp 2013 migration
 
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
Node setup, resource, and recipes - Fundamentals Webinar Series Part 2
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best Practices
 
Battling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support TaleBattling the WSOD - A Tech Support Tale
Battling the WSOD - A Tech Support Tale
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest API
 

More from Shawn Hooper

More from Shawn Hooper (12)

Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress Security
 
WP REST API: Actionable.co
WP REST API: Actionable.coWP REST API: Actionable.co
WP REST API: Actionable.co
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS Products
 
Payments Made Easy with Stripe
Payments Made Easy with StripePayments Made Easy with Stripe
Payments Made Easy with Stripe
 
WordPress Coding Standards & Best Practices
WordPress Coding Standards & Best PracticesWordPress Coding Standards & Best Practices
WordPress Coding Standards & Best Practices
 
Writing Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPressWriting Clean, Standards Compliant, Testable Code for WordPress
Writing Clean, Standards Compliant, Testable Code for WordPress
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress Websites
 
Securing WordPress
Securing WordPressSecuring WordPress
Securing WordPress
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPress
 
Hooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp ColumbusHooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp Columbus
 
Time Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-CronTime Code: Automating Tasks in WordPress with WP-Cron
Time Code: Automating Tasks in WordPress with WP-Cron
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Recently uploaded (20)

Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot ModelNavi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
Navi Mumbai Call Girls 🥰 8617370543 Service Offer VIP Hot Model
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
Emergent Methods: Multi-lingual narrative tracking in the news - real-time ex...
 
Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...Apidays New York 2024 - The value of a flexible API Management solution for O...
Apidays New York 2024 - The value of a flexible API Management solution for O...
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...2024: Domino Containers - The Next Step. News from the Domino Container commu...
2024: Domino Containers - The Next Step. News from the Domino Container commu...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Corporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptxCorporate and higher education May webinar.pptx
Corporate and higher education May webinar.pptx
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 
Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024Manulife - Insurer Transformation Award 2024
Manulife - Insurer Transformation Award 2024
 

Manage WordPress From the Command Line with WP-CLI

  • 1. WP-CLI: Save Time by Managing WordPress from the Command Line WordCamp Tampa 2015 ! Shawn Hooper
 Chief Technology Officer,Actionable Books @shawnhooper - shawnhooper.ca
  • 2. • I’m Shawn Hooper, a web application developer from Ottawa. • I’ve been working in WordPress since 2009. • I love the working from the command prompt, reminds me of my days running a BBS (in the days before the Internet) Hi! @shawnhooper - shawnhooper.ca
  • 4. • A set of command line tools that allows you to manage WordPress from the command line.
 • http://www.wp-cli.org/ What is WP-CLI ? @shawnhooper - shawnhooper.ca
  • 5. • Anyone really, but mostly: • Developers • Theme Designers • Server Administrators Who is this for? @shawnhooper - shawnhooper.ca
  • 6. Don’t Fear The Command Line @shawnhooper - shawnhooper.ca
  • 7. • http://www.wp-cli.org/ • Requires PHP 5.3.2 or later • Requires WordPress 3.5.2 or later • A “UNIX-like” environment: • OSX (Macintosh) • Linux • Cygwin (Windows) What do you need? @shawnhooper - shawnhooper.ca
  • 8. • You need to have SSH access to use WP-CLI. Some shared hosting packages do not allow SSH access • PlanetHoster, SiteGround, Pantheon, BlueHost, GoDaddy, Media Temple, Windows Azure and more now have CLI support. • VPS services like Digital Ocean and Linode, Atlantic.net are ideal. Hosts @shawnhooper - shawnhooper.ca
  • 9. • Download it:
 curl -O https://raw.githubusercontent.com/ wp-cli/builds/gh-pages/phar/wp-cli.phar
 • Set permissions: 
 chmod +x wp-cli.phar
 • Move it somewhere useful:
 sudo mv wp-cli.phar /usr/local/bin/wp 
 Installing WP-CLI @shawnhooper - shawnhooper.ca
  • 10. • Does it work? Type:
 
 wp
 Installing WP-CLI @shawnhooper - shawnhooper.ca
  • 12. Congratulations! (that was the hard part) @shawnhooper - shawnhooper.ca
  • 13. Great… It’s installed. So now what…. @shawnhooper - shawnhooper.ca
  • 14. wp <command> <sub-command> <params> Running Commands: @shawnhooper - shawnhooper.ca
  • 15. <param> — required [—param] — optional flag [—param=<value>] — optional w/ value Running Commands: @shawnhooper - shawnhooper.ca
  • 16. • Check current WordPress version, or see if there are updates available. • Do the update! • Install a brand new site • Convert an existing site to Multisite! • Verify core checksums core @shawnhooper - shawnhooper.ca
  • 17. • Let’s try setting up a brand new site on a development server using:
 
 wp core download
 wp core config
 wp db create
 wp core install --prompt core @shawnhooper - shawnhooper.ca
  • 18. • Install, Delete Plugins • Activate & Deactivate Plugins • Update Plugins • Search the repository for plugins plugin @shawnhooper - shawnhooper.ca
  • 19. • Time savers!
 
 wp plugin update — all
 
 wp plugin deactivate — all plugin @shawnhooper - shawnhooper.ca
  • 20. The “db” command interacts with the MySQL database. ! wp db export backup.sql
 
 wp db import backup.sql
 
 wp db cli db @shawnhooper - shawnhooper.ca
  • 21. • Safe Search & Replace, including serialized arrays!
 • Supports --dry-run search-replace @shawnhooper - shawnhooper.ca
  • 22. Generate Test Content ! wp post generate --count=500 post @shawnhooper - shawnhooper.ca
  • 23. Create Posts with Random Content using Any Ipsum Plugin ! wp plugin install any-ipsum — activate
 wp any-ipsum generate-posts 100 post @shawnhooper - shawnhooper.ca
  • 24. Regenerate Thumbnails ! wp media regenerate —yes media @shawnhooper - shawnhooper.ca
  • 25. Start an underscores theme! ! wp scaffold _s mytheme scaffold @shawnhooper - shawnhooper.ca
  • 26. … or a child theme ! wp scaffold child-theme mychild —parent_theme=twentyfourteen scaffold @shawnhooper - shawnhooper.ca
  • 27. … or a custom post type ! wp scaffold post-type mycpt — theme scaffold @shawnhooper - shawnhooper.ca
  • 28. Download & Activate a Theme from WordPress.org ! wp theme install simone —activate theme @shawnhooper - shawnhooper.ca
  • 29. wp user generate wp user import-csv Create Users @shawnhooper - shawnhooper.ca
  • 30. wp term list wp term create wp term generate Taxonomies @shawnhooper - shawnhooper.ca
  • 31. Executes PHP code
 * after loading the WordPress Core * eval & eval-file @shawnhooper - shawnhooper.ca
  • 32. wp role create wp role list wp role exists ! new: —clone flag on create role & cap @shawnhooper - shawnhooper.ca
  • 33. Launches PHP’s Built-in Web Server ! wp server server @shawnhooper - shawnhooper.ca
  • 34. Add any functionality you want that isn’t already included in the WP-CLI core. https://github.com/wp-cli/wp-cli/ wiki/List-of-community-commands Community Commands @shawnhooper - shawnhooper.ca
  • 35. You can either write them as a plugin, or include it using the
 —require parameter
 on the command line. Community Commands @shawnhooper - shawnhooper.ca
  • 36. Thank you!
 Slides: www.shawnhooper.ca
 E-Mail: shawn@actionablebooks.com
 Twitter: @shawnhooper
 WordPress Slack: shooper @shawnhooper - shawnhooper.ca