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 ShowcasesJun Hu
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command LineKelly Dwan
 
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 2012Ben Metcalfe
 
Desktop server presentation
Desktop server presentationDesktop server presentation
Desktop server presentationKen Kramer
 
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 sitesThomas Audunhus
 
CPAN Dependency Heaven
CPAN Dependency HeavenCPAN Dependency Heaven
CPAN Dependency HeavenOpusVL
 
Saving Time with WP-CLI
Saving Time with WP-CLISaving Time with WP-CLI
Saving Time with WP-CLITaylor Lovett
 
Best Practices for WordPress
Best Practices for WordPressBest Practices for WordPress
Best Practices for WordPressTaylor Lovett
 
Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)Optimizing WordPress (WordCamp Philly 2011)
Optimizing WordPress (WordCamp Philly 2011)Ben Metcalfe
 
WordPress Security & Backup
WordPress Security & Backup WordPress Security & Backup
WordPress Security & Backup Randy Barnes
 
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-CLIMichael Corkum
 
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
 
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 WebsiteKristine Howard
 
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 PHPTaylor Lovett
 
Creating Local WordPress Installs
Creating Local WordPress InstallsCreating Local WordPress Installs
Creating Local WordPress Installsmcgaritydotme
 
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.jsJeff Geerling
 

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

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 LineShawn Hooper
 
WP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealWP-CLI Talk from WordCamp Montreal
WP-CLI Talk from WordCamp MontrealShawn Hooper
 
WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015WP-CLI - WordCamp Miami 2015
WP-CLI - WordCamp Miami 2015Shawn Hooper
 
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...Chef Software, Inc.
 
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.0Morten Rand-Hendriksen
 
WordPress CLI in-depth
WordPress CLI in-depthWordPress CLI in-depth
WordPress CLI in-depthSanjay Willie
 
WordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersWordPress London Developer Operations For Beginners
WordPress London Developer Operations For BeginnersStewart Ritchie
 
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)darren_puscas
 
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...Andrea Cardinali
 
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 HawkinsNETWAYS
 
Wordpress website development
Wordpress website developmentWordpress website development
Wordpress website developmentJohn Faust
 
Introduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitIntroduction to Chef - Techsuperwomen Summit
Introduction to Chef - Techsuperwomen SummitJennifer Davis
 
WordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationWordCamp Sheffield 2014 Theme Workflow Presentation
WordCamp Sheffield 2014 Theme Workflow PresentationJonny Allbut
 
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...Andy Kucharski
 
Word camp 2013 migration
Word camp 2013 migrationWord camp 2013 migration
Word camp 2013 migrationMatt Siltala
 
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 2Chef
 
WordPress Security and Best Practices
WordPress Security and Best PracticesWordPress Security and Best Practices
WordPress Security and Best PracticesRobert Vidal
 
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 TaleKayleigh Thorpe
 
WordPress Rest API
WordPress Rest APIWordPress Rest API
WordPress Rest APIBrian Layman
 

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

Introduction to WordPress Security
Introduction to WordPress SecurityIntroduction to WordPress Security
Introduction to WordPress SecurityShawn Hooper
 
WP REST API: Actionable.co
WP REST API: Actionable.coWP REST API: Actionable.co
WP REST API: Actionable.coShawn Hooper
 
Database Considerations for SaaS Products
Database Considerations for SaaS ProductsDatabase Considerations for SaaS Products
Database Considerations for SaaS ProductsShawn Hooper
 
Payments Made Easy with Stripe
Payments Made Easy with StripePayments Made Easy with Stripe
Payments Made Easy with StripeShawn Hooper
 
WordPress Coding Standards & Best Practices
WordPress Coding Standards & Best PracticesWordPress Coding Standards & Best Practices
WordPress Coding Standards & Best PracticesShawn Hooper
 
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 WordPressShawn Hooper
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesShawn Hooper
 
Creating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesCreating Multilingual WordPress Websites
Creating Multilingual WordPress WebsitesShawn Hooper
 
Securing WordPress
Securing WordPressSecuring WordPress
Securing WordPressShawn Hooper
 
Writing Secure Code for WordPress
Writing Secure Code for WordPressWriting Secure Code for WordPress
Writing Secure Code for WordPressShawn Hooper
 
Hooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp ColumbusHooked on WordPress: WordCamp Columbus
Hooked on WordPress: WordCamp ColumbusShawn Hooper
 
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-CronShawn 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

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Enterprise Knowledge
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfngoud9212
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsMark Billinghurst
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Patryk Bandurski
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDGMarianaLemus7
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitecturePixlogix Infotech
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machinePadma Pradeep
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 3652toLead Limited
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfjimielynbastida
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions
 

Recently uploaded (20)

Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024Designing IA for AI - Information Architecture Conference 2024
Designing IA for AI - Information Architecture Conference 2024
 
Bluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdfBluetooth Controlled Car with Arduino.pdf
Bluetooth Controlled Car with Arduino.pdf
 
Human Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR SystemsHuman Factors of XR: Using Human Factors to Design XR Systems
Human Factors of XR: Using Human Factors to Design XR Systems
 
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
Integration and Automation in Practice: CI/CD in Mule Integration and Automat...
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
APIForce Zurich 5 April Automation LPDG
APIForce Zurich 5 April  Automation LPDGAPIForce Zurich 5 April  Automation LPDG
APIForce Zurich 5 April Automation LPDG
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Understanding the Laravel MVC Architecture
Understanding the Laravel MVC ArchitectureUnderstanding the Laravel MVC Architecture
Understanding the Laravel MVC Architecture
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
DMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special EditionDMCC Future of Trade Web3 - Special Edition
DMCC Future of Trade Web3 - Special Edition
 
Install Stable Diffusion in windows machine
Install Stable Diffusion in windows machineInstall Stable Diffusion in windows machine
Install Stable Diffusion in windows machine
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort ServiceHot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
Hot Sexy call girls in Panjabi Bagh 🔝 9953056974 🔝 Delhi escort Service
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
Tech-Forward - Achieving Business Readiness For Copilot in Microsoft 365
 
Science&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdfScience&tech:THE INFORMATION AGE STS.pdf
Science&tech:THE INFORMATION AGE STS.pdf
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
Pigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food ManufacturingPigging Solutions in Pet Food Manufacturing
Pigging Solutions in Pet Food Manufacturing
 

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