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
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
180
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
88
objects-a-short-intro.pdf
kjohnson
0
200
Other Decks in Programming
See All in Programming
20年以上続くプロダクトでも使い続けられる静的解析ツールを求めて
matsuo_atsushi
0
130
My daily life on Ruby
a_matsuda
3
180
Agentic Elixir
whatyouhide
0
440
Liberating Ruby's Parser from Lexer Hacks
ydah
2
2.6k
Road to RubyKaigi: Play Hard(ware)
makicamel
1
540
書き換えて学ぶTemporal #fukts
pirosikick
2
350
Symfony AI in Action - SymfonyLive Berlin 2026
chr_hertel
1
110
JOAI2026 1st solution - heron0519 -
heron0519
0
170
When benchmarks go bad - what I learned from measuring performance wrong
hollycummins
0
350
Explore CoroutineScope
tomoeng11
0
160
【26新卒研修資料】TDD実装演習
dip_tech
PRO
0
160
空間オーディオの活用
objectiveaudio
0
120
Featured
See All Featured
Heart Work Chapter 1 - Part 1
lfama
PRO
6
35k
Rails Girls Zürich Keynote
gr2m
96
14k
Let's Do A Bunch of Simple Stuff to Make Websites Faster
chriscoyier
508
140k
Designing for Timeless Needs
cassininazir
0
220
BBQ
matthewcrist
89
10k
Neural Spatial Audio Processing for Sound Field Analysis and Control
skoyamalab
0
290
The browser strikes back
jonoalderson
0
1k
Groundhog Day: Seeking Process in Gaming for Health
codingconduct
0
170
Leading Effective Engineering Teams in the AI Era
addyosmani
9
1.9k
Java REST API Framework Comparison - PWX 2021
mraible
34
9.3k
Being A Developer After 40
akosma
91
590k
Ecommerce SEO: The Keys for Success Now & Beyond - #SERPConf2024
aleyda
1
2k
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