Upgrade to Pro
— share decks privately, control downloads, hide ads and more …
Speaker Deck
Features
Speaker Deck
PRO
Sign in
Sign up for free
Search
Search
Introduction to WP-CLI
Search
Kyle B. Johnson
November 02, 2017
Programming
0
320
Introduction to WP-CLI
Kyle B. Johnson
November 02, 2017
Tweet
Share
More Decks by Kyle B. Johnson
See All by Kyle B. Johnson
Continuously Delivering Value
kjohnson
0
130
Building Pages in WordPress
kjohnson
0
150
Gutenberg
kjohnson
0
370
Separate your time from your income
kjohnson
0
450
iThemes Exchange
kjohnson
0
110
Easy Digital Downloads
kjohnson
0
82
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
84
objects-a-short-intro.pdf
kjohnson
0
190
Other Decks in Programming
See All in Programming
Vue・React マルチプロダクト開発を支える Vite
andpad
0
110
AWS発のAIエディタKiroを使ってみた
iriikeita
1
150
RDoc meets YARD
okuramasafumi
4
160
プロポーザル駆動学習 / Proposal-Driven Learning
mackey0225
2
440
時間軸から考えるTerraformを使う理由と留意点
fufuhu
12
4k
Testing Trophyは叫ばない
toms74209200
0
520
ソフトウェアテスト徹底指南書の紹介
goyoki
1
140
もうちょっといいRubyプロファイラを作りたい (2025)
osyoyu
0
240
Langfuseと歩む生成AI活用推進
licux
3
320
Design Foundational Data Engineering Observability
sucitw
2
150
AI時代のUIはどこへ行く?
yusukebe
12
7.2k
The state patternの実践 個人開発で培ったpractice集
miyanokomiya
0
160
Featured
See All Featured
Building Better People: How to give real-time feedback that sticks.
wjessup
368
19k
ReactJS: Keep Simple. Everything can be a component!
pedronauck
667
120k
KATA
mclloyd
32
14k
Documentation Writing (for coders)
carmenintech
73
5k
Visualization
eitanlees
147
16k
Sharpening the Axe: The Primacy of Toolmaking
bcantrill
44
2.5k
Distributed Sagas: A Protocol for Coordinating Microservices
caitiem20
333
22k
How STYLIGHT went responsive
nonsquared
100
5.8k
Statistics for Hackers
jakevdp
799
220k
Connecting the Dots Between Site Speed, User Experience & Your Business [WebExpo 2025]
tammyeverts
8
510
Building a Scalable Design System with Sketch
lauravandoore
462
33k
No one is an island. Learnings from fostering a developers community.
thoeni
21
3.4k
Transcript
The command line interface for WordPress_ ./WP-CLI
$ wp plugin install ninja-forms Installing Ninja Forms (3.0) Downloading
install package... Unpacking the package... Installing the plugin... Plugin installed successfully. Success: Installed 1 of 1 plugins.
$ wp core download Downloading WordPress 4.8 Md5 hash verified:
c5366d0521831dd029dfc38e56a5 Success: WordPress downloaded.
$ wp core install Success: WordPress installed successfully.
$ wp plugin update Updating to version 4.9 Downloading update...
Unpacking the update... Success: WordPress updated successfully.
Use Cases
Example Use Cases • Plugin/Theme Development • Local Development Environments
• Client Site Maintenance • WordPress as a Service
Plugin/Theme Development • Scaffold new plugins • Run PHPUnit tests
Local Development Environments • Download/Install/Update WordPress • Auto install plugins/themes
• Search/Replace database values (site migration) • Launch PHP’s built-in web server $ wp serve –-host=wordpress.dev ~/code/wordpress now available at wordpress.dev:80
Client Site Maintenance • Remotely Update WordPress (SSH) • Check
for plugin updates • Restore down sites (white-screen of death) $ wp plugin deactivate <plugin name> --skip-plugins Success: Plugin <plugin name> deactivated.
WordPress as a Service • Check for updates • Create
user accounts • Create new installs $ wp site create --slug=example Success: Site 3 created. wordpress.dev/example
Extending WP-CLI
$ wp ninja-forms list-forms public function list_forms( $args, $assoc_args )
{ foreach( Ninja_Forms()->forms() as $form ){ WP_CLI::line( ‘#’ . $form[‘title’] ); } }
Outside of WordPress
Laravel $ artisan # Generate a new controller. $ artisan
make:controller PostController # Re-run database migration with seed data. $ artisan migrate:refresh --seeds
Drupal $ drush # Run pending updates on staging site.
$ drush @staging updatedb # Synchronize staging files to production. $ drush rsync @staging @ list