WP-CLI is a command line interface tool that allows users to manage WordPress from the command line. It is useful for site administrators, plugin developers, theme designers, and anyone wanting to save time. To use WP-CLI, it must be installed on a server with SSH access and requires PHP 5.3.29 or later and WordPress 3.7 or later. Common commands are used by specifying "wp" followed by the command, sub-command, and any parameters.
Save Time By Manging WordPress from the Command Line
1. Blog - shawnhooper.ca
Twitter - @shawnhooper
WP-CLI:
Save Time by Managing
WordPress from the
Command Line
WordCamp Rochester 2016
Shawn Hooper
Director of IT, actionable.co
2. Blog - shawnhooper.ca
Twitter - @shawnhooper
WP-CLI is a set of tools that allows you to manage
your WordPress website from the command line.
https://wp-cli.org/
What is WP-CLI ?
4. Blog - shawnhooper.ca
Twitter - @shawnhooper
Site / Server Administrators
Plugin Developers
Theme Designers
… anyone who wants to do more in less time.
Who Is It For?
6. Blog - shawnhooper.ca
Twitter - @shawnhooper
WP-CLI, available at wp-cli.org
UNIX-like environment (OS X, Linux, FreeBSD,
Cygwin); limited support in Windows environment
PHP 5.3.29 or later
WordPress 3.7 or later
What do you need?
7. Blog - shawnhooper.ca
Twitter - @shawnhooper
You need to have SSH access to use WP-CLI.
Not all web hosts allow SSH access.
SiteGround, Pantheon, BlueHost, GoDaddy, Media
Temple, Windows Azure and more now have CLI
support.
It also works great with VPS services like
DigitalOcean, Linode and Amazon Web Services.
In Production…
8. Blog - shawnhooper.ca
Twitter - @shawnhooper
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
14. Blog - shawnhooper.ca
Twitter - @shawnhooper
The --prompt flag
guides you through parameters.
The --help parameter
on any command will tell you what it does,
the parameters it accepts, etc.
Running Commands
16. Blog - shawnhooper.ca
Twitter - @shawnhooper
WP-CLI packages are community-maintained
commands you can install with
wp package install
http://wp-cli.org/package-index/
Packages
17. Blog - shawnhooper.ca
Twitter - @shawnhooper
Plugins that include WP-CLI commands
as a feature.
http://wp-cli.org/docs/tools/
Tools
19. Blog - shawnhooper.ca
Twitter - @shawnhooper
Advanced Custom Fields (ACF)
Any Ipsum
BackupBuddy
Google Site Map Generator
WP DB Migrate Pro
Redis Object Cache
WP Revisions CLI
…. and more.
Tools
20. Blog - shawnhooper.ca
Twitter - @shawnhooper
You can find these slides, notes and more at
shawnhooper.ca
Tweet Me @shawnhooper
WordPress Slack: shooper
Thank You!