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
340
0
Share
Introduction to WP-CLI
Kyle B. Johnson
November 02, 2017
More Decks by Kyle B. Johnson
See All by Kyle B. Johnson
Continuously Delivering Value
kjohnson
0
140
Building Pages in WordPress
kjohnson
0
180
Gutenberg
kjohnson
0
380
Separate your time from your income
kjohnson
0
490
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
84
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
88
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
新規プロダクトを高速で生み出すハーネスエンジニアリング
seanchas116
18
7.6k
JJUG CCC 2026 Spring: JSpecify で実現する Kotlin フレンドリーな Java API 設計
ternbusty
1
110
メソッドのジェネリクスでGoの夢は広がるか? / Kyoto.go #65
utgwkk
0
260
ReactとSvelteのその先、Ripple-TS / Beyond React and Svelte: Ripple-TS
ssssota
3
1.8k
Oxlintのカスタムルールの現況
syumai
5
920
権限チェックの一貫性を型で守る TypeScript による多層防御
mnch
4
990
AIチームを指揮するOSS「TAKT」活用術 / How to Use “TAKT,” an OSS Tool for Orchestrating AI Teams
nrslib
6
760
生成AI時代にこそ効くGo | Why Go Works in the Age of Generative AI
mom0tomo
8
3k
Claspは野良GASの夢をみるか
takter00
0
140
軽量Java基盤の設計 DIコンテナに頼らない、長期保守と1秒起動の実現 JJUG CCC 2026 Spring
macha64
0
260
Composerを使ったサプライチェーン攻撃の様子を眺めてみる #phpstudy
o0h
PRO
2
200
代数的データ型って何が嬉しいの? #frontend_phpcon_do
kajitack
7
2.6k
Featured
See All Featured
Google's AI Overviews - The New Search
badams
0
1k
Agile Actions for Facilitating Distributed Teams - ADO2019
mkilby
0
200
Jess Joyce - The Pitfalls of Following Frameworks
techseoconnect
PRO
1
160
The Curse of the Amulet
leimatthew05
1
13k
Site-Speed That Sticks
csswizardry
13
1.2k
AI: The stuff that nobody shows you
jnunemaker
PRO
7
670
Practical Orchestrator
shlominoach
191
11k
Designing Experiences People Love
moore
143
24k
Design and Strategy: How to Deal with People Who Don’t "Get" Design
morganepeng
133
19k
Design in an AI World
tapps
1
220
Lightning talk: Run Django tests with GitHub Actions
sabderemane
0
190
ReactJS: Keep Simple. Everything can be a component!
pedronauck
666
130k
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