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
330
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
140
Building Pages in WordPress
kjohnson
0
170
Gutenberg
kjohnson
0
380
Separate your time from your income
kjohnson
0
470
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
84
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
86
objects-a-short-intro.pdf
kjohnson
0
190
Other Decks in Programming
See All in Programming
humanlayerのブログから学ぶ、良いCLAUDE.mdの書き方
tsukamoto1783
0
180
Automatic Grammar Agreementと Markdown Extended Attributes について
kishikawakatsumi
0
180
CSC307 Lecture 03
javiergs
PRO
1
490
Oxlint JS plugins
kazupon
1
740
Lambda のコードストレージ容量に気をつけましょう
tattwan718
0
110
15年続くIoTサービスのSREエンジニアが挑む分散トレーシング導入
melonps
2
170
AI によるインシデント初動調査の自動化を行う AI インシデントコマンダーを作った話
azukiazusa1
1
690
疑似コードによるプロンプト記述、どのくらい正確に実行される?
kokuyouwind
0
380
Oxlintはいいぞ
yug1224
5
1.3k
AtCoder Conference 2025
shindannin
0
1k
カスタマーサクセス業務を変革したヘルススコアの実現と学び
_hummer0724
0
630
Unicodeどうしてる? PHPから見たUnicode対応と他言語での対応についてのお伺い
youkidearitai
PRO
1
1.1k
Featured
See All Featured
The SEO Collaboration Effect
kristinabergwall1
0
350
RailsConf & Balkan Ruby 2019: The Past, Present, and Future of Rails at GitHub
eileencodes
141
34k
Leveraging Curiosity to Care for An Aging Population
cassininazir
1
160
AI in Enterprises - Java and Open Source to the Rescue
ivargrimstad
0
1.1k
Gemini Prompt Engineering: Practical Techniques for Tangible AI Outcomes
mfonobong
2
280
Claude Code のすすめ
schroneko
67
210k
CSS Pre-Processors: Stylus, Less & Sass
bermonpainter
359
30k
Building a A Zero-Code AI SEO Workflow
portentint
PRO
0
300
The innovator’s Mindset - Leading Through an Era of Exponential Change - McGill University 2025
jdejongh
PRO
1
88
SEO Brein meetup: CTRL+C is not how to scale international SEO
lindahogenes
0
2.3k
The Straight Up "How To Draw Better" Workshop
denniskardys
239
140k
The Curious Case for Waylosing
cassininazir
0
230
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