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
200
Other Decks in Programming
See All in Programming
「やめとこ」がなくなった — 1月にZennを始めて22本書いた AI共創開発のリアル
atani14
0
370
Go1.26 go fixをプロダクトに適用して困ったこと
kurakura0916
0
350
go directiveを最新にしすぎないで欲しい話──あるいは、Go 1.26からgo mod initで作られるgo directiveの値が変わる話 / Go 1.26 リリースパーティ
arthur1
2
520
どんと来い、データベース信頼性エンジニアリング / Introduction to DBRE
nnaka2992
1
260
メタプログラミングで実現する「コードを仕様にする」仕組み/nikkei-tech-talk43
nikkei_engineer_recruiting
0
170
Unity6.3 AudioUpdate
cova8bitdots
0
120
今、アーキテクトとして 品質保証にどう関わるか
nealle
0
210
New in Go 1.26 Implementing go fix in product development
sunecosuri
0
400
Claude Code の Skill で複雑な既存仕様をすっきり整理しよう
yuichirokato
1
350
Agentic AI: Evolution oder Revolution
mobilelarson
PRO
0
140
Vuetify 3 → 4 何が変わった?差分と移行ポイント10分まとめ
koukimiura
0
110
Geminiの機能を調べ尽くしてみた
naruyoshimi
0
200
Featured
See All Featured
Have SEOs Ruined the Internet? - User Awareness of SEO in 2025
akashhashmi
0
290
What does AI have to do with Human Rights?
axbom
PRO
1
2k
Context Engineering - Making Every Token Count
addyosmani
9
740
Building a Scalable Design System with Sketch
lauravandoore
463
34k
Large-scale JavaScript Application Architecture
addyosmani
515
110k
YesSQL, Process and Tooling at Scale
rocio
174
15k
The World Runs on Bad Software
bkeepers
PRO
72
12k
What the history of the web can teach us about the future of AI
inesmontani
PRO
1
460
[RailsConf 2023] Rails as a piece of cake
palkan
59
6.4k
What’s in a name? Adding method to the madness
productmarketing
PRO
24
4k
From Legacy to Launchpad: Building Startup-Ready Communities
dugsong
0
170
How to Get Subject Matter Experts Bought In and Actively Contributing to SEO & PR Initiatives.
livdayseo
0
82
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