Slides from my presentation given at WordCamp Tampa 2015. Save time performing common WordPress installation and maintenance tasks with the WP-CLI library.
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
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
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
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
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