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
Embed
Copy iframe code
Copy JS code
Copy link
Start on current slide
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
200
Gutenberg
kjohnson
0
390
Separate your time from your income
kjohnson
0
490
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
85
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
90
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
ITヒヤリハットを整理してみた ~ライフサイクルと原因から考える再発防止策~
koukimiura
1
110
コーディングルールの鮮度を保ちたい for SRE NEXT 2026 / keep-fresh-go-internal-conventions-sre-next-2026
handlename
0
150
人間の目はかわらない、だからJPEGは30年もつ
yuzneri
1
390
信頼性について考えてみる(SRE NEXT 2026 miniLT)
hayama17
0
210
act1-costs.pdf
sumedhbala
0
240
GDG Korea Android: 2026 I/O Extended ~ What's new in Android development tools
pluu
0
110
AI時代のPHPer生存戦略 ~「言語、もうなんでもよくない?」に本気で向き合う~
vivion
0
150
PHPだって関数型したい 〜できること、できないこと〜 / fp-in-php
jsoizo
1
240
どこまでゆるくて許されるのか
tk3fftk
0
520
The Bowling Game- From Imperative to Functional Programming - Part 1
philipschwarz
PRO
0
340
【SRE NEXT 2026 Lunch Session】一人目専任SREの立ち上げを加速する ― AIと進めたオンボーディングで2分を0.04秒にした話
pkshadeck
PRO
0
3k
PHP Application における Kubernetes 内 gRPC 通信
ganchiku
0
530
Featured
See All Featured
Designing Powerful Visuals for Engaging Learning
tmiket
1
460
Efficient Content Optimization with Google Search Console & Apps Script
katarinadahlin
PRO
1
740
Fantastic passwords and where to find them - at NoRuKo
philnash
52
3.8k
Product Roadmaps are Hard
iamctodd
55
12k
Hiding What from Whom? A Critical Review of the History of Programming languages for Music
tomoyanonymous
3
1k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.5k
State of Search Keynote: SEO is Dead Long Live SEO
ryanjones
0
220
WENDY [Excerpt]
tessaabrams
11
38k
The Anti-SEO Checklist Checklist. Pubcon Cyber Week
ryanjones
0
190
Winning Ecommerce Organic Search in an AI Era - #searchnstuff2025
aleyda
1
2.1k
16th Malabo Montpellier Forum Presentation
akademiya2063
PRO
0
280
Redefining SEO in the New Era of Traffic Generation
szymonslowik
1
370
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