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
320
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
130
Building Pages in WordPress
kjohnson
0
150
Gutenberg
kjohnson
0
370
Separate your time from your income
kjohnson
0
440
iThemes Exchange
kjohnson
0
100
Easy Digital Downloads
kjohnson
0
82
PHP Templating
kjohnson
0
130
WordPress Taxonomies
kjohnson
0
80
objects-a-short-intro.pdf
kjohnson
0
180
Other Decks in Programming
See All in Programming
Railsアプリケーションと パフォーマンスチューニング ー 秒間5万リクエストの モバイルオーダーシステムを支える事例 ー Rubyセミナー 大阪
falcon8823
4
960
コードの90%をAIが書く世界で何が待っているのか / What awaits us in a world where 90% of the code is written by AI
rkaga
47
31k
イベントストーミング図からコードへの変換手順 / Procedure for Converting Event Storming Diagrams to Code
nrslib
1
450
Java on Azure で LangGraph!
kohei3110
0
170
技術同人誌をMCP Serverにしてみた
74th
1
380
AIエージェントはこう育てる - GitHub Copilot Agentとチームの共進化サイクル
koboriakira
0
440
Is Xcode slowly dying out in 2025?
uetyo
1
200
Bytecode Manipulation 으로 생산성 높이기
bigstark
2
380
LT 2025-06-30: プロダクトエンジニアの役割
yamamotok
0
510
データの民主化を支える、透明性のあるデータ利活用への挑戦 2025-06-25 Database Engineering Meetup#7
y_ken
0
320
High-Level Programming Languages in AI Era -Human Thought and Mind-
hayat01sh1da
PRO
0
470
XP, Testing and ninja testing
m_seki
3
200
Featured
See All Featured
How to Create Impact in a Changing Tech Landscape [PerfNow 2023]
tammyeverts
53
2.8k
The Cost Of JavaScript in 2023
addyosmani
51
8.5k
The Power of CSS Pseudo Elements
geoffreycrofte
77
5.8k
Building a Modern Day E-commerce SEO Strategy
aleyda
42
7.3k
Designing Experiences People Love
moore
142
24k
Code Reviewing Like a Champion
maltzj
524
40k
Adopting Sorbet at Scale
ufuk
77
9.4k
Building an army of robots
kneath
306
45k
The Art of Delivering Value - GDevCon NA Keynote
reverentgeek
15
1.5k
GitHub's CSS Performance
jonrohan
1031
460k
Building Applications with DynamoDB
mza
95
6.5k
Art, The Web, and Tiny UX
lynnandtonic
299
21k
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