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
480
iThemes Exchange
kjohnson
0
130
Easy Digital Downloads
kjohnson
0
84
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
87
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
Claude Code Skill入門
mayahoney
0
440
実践ハーネスエンジニアリング #MOSHTech
kajitack
7
4.7k
LM Linkで(非力な!)ノートPCでローカルLLM
seosoft
0
260
ポーリング処理廃止によるイベント駆動アーキテクチャへの移行
seitarof
3
1.3k
Codex CLIのSubagentsによる並列API実装 / Parallel API Implementation with Codex CLI Subagents
takatty
2
680
「接続」—パフォーマンスチューニングの最後の一手 〜点と点を結ぶ、その一瞬のために〜
kentaroutakeda
4
2.1k
PHP 7.4でもOpenTelemetryゼロコード計装がしたい! / PHPerKaigi 2026
arthur1
1
430
Migration to Signals, Signal Forms, Resource API, and NgRx Signal Store @Angular Days 03/2026 Munich
manfredsteyer
PRO
0
180
AIコードレビューの導入・運用と AI駆動開発における「AI4QA」の取り組みについて
hagevvashi
0
570
それはエンジニアリングの糧である:AI開発のためにAIのOSSを開発する現場より / It serves as fuel for engineering: insights from the field of developing open-source AI for AI development.
nrslib
1
630
安いハードウェアでVulkan
fadis
1
830
Claude Codeログ基盤の構築
giginet
PRO
7
3.7k
Featured
See All Featured
Building the Perfect Custom Keyboard
takai
2
720
Discover your Explorer Soul
emna__ayadi
2
1.1k
Reality Check: Gamification 10 Years Later
codingconduct
0
2.1k
Navigating Team Friction
lara
192
16k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
130
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
91
Joys of Absence: A Defence of Solitary Play
codingconduct
1
330
Money Talks: Using Revenue to Get Sh*t Done
nikkihalliwell
0
190
Getting science done with accelerated Python computing platforms
jacobtomlinson
2
150
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
Impact Scores and Hybrid Strategies: The future of link building
tamaranovitovic
0
240
The #1 spot is gone: here's how to win anyway
tamaranovitovic
2
1k
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