save time by manging wordpress from the command line
TRANSCRIPT
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
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 ?
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?
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?
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…
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
Blog - shawnhooper.ca Twitter - @shawnhooper
Does It Work?
> wp
Installing WP-CLI
Blog - shawnhooper.ca Twitter - @shawnhooper
That was the hard part.
Congratulations!
Blog - shawnhooper.ca Twitter - @shawnhooper
wp <command> <sub-command> <params>
Running Commands
Blog - shawnhooper.ca Twitter - @shawnhooper
<param> — required
[--param] — optional flag
[--param=<value>] — optional w/ value
Running Commands
Blog - shawnhooper.ca Twitter - @shawnhooper
The --prompt flag
guides you through parameters.
The --help parameteron any command will tell you what it does,
the parameters it accepts, etc.
Running Commands
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
Blog - shawnhooper.ca Twitter - @shawnhooper
Plugins that include WP-CLI commands
as a feature.
http://wp-cli.org/docs/tools/
Tools
Blog - shawnhooper.ca Twitter - @shawnhooper
Advanced Custom Fields (ACF) Any Ipsum
BackupBuddy Google Site Map Generator
WP DB Migrate ProRedis Object Cache
WP Revisions CLI
…. and more.
Tools
Blog - shawnhooper.ca Twitter - @shawnhooper
You can find these slides, notes and more atshawnhooper.ca
Tweet Me @shawnhooper
WordPress Slack: shooper
Thank You!