SlideShare une entreprise Scribd logo
1  sur  51
Télécharger pour lire hors ligne
WP-CLI FOR THE WIN!
MICAH WOOD
HTTPS://WPSCHOLAR.COM
@WPSCHOLAR
WHAT IS WP-CLI?
WORDPRESS

COMMAND-LINE INTERFACE
you@machine:~$
WHY WP-CLI?
“Pointing and clicking is better… 

why type in the command line?”
…it saves time.
…you can manage WordPress content.
…you can manage WordPress code.
…you can do things you can’t do in the admin.
…long running tasks won’t timeout.
…you can generate code.
…you can script repetitive tasks.
AUTOMATION!
INSTALLING WP-CLI
https://make.wordpress.org/cli/handbook/installing/
composer global install wp-cli/wp-cli
NEW PROJECT
INSTALL WORDPRESS
wp core download
wp config create --prompt=dbname,dbuser,dbpass
wp db create
wp core install --prompt
INSTALL & ACTIVATE PLUGINS
wp plugin install wordpress-seo
wp plugin activate wordpress-seo
wp plugin install wordpress-seo --activate
SCAFFOLD NEW THEME
wp scaffold theme --prompt
CREATE TEST CONTENT
wp plugin install wordpress-importer --activate
curl -O https://raw.githubusercontent.com/poststatus/wptest/master/wptest.xml
wp import wptest.xml --authors=create
EXISTING PROJECT
CHECK FOR HACKED FILES
wp core verify-checksums --version=$(wp core version)
IMPORT DATABASE
wp db import <file>
CREATE A USER
wp create user <username> <email> --role=administrator
MIGRATE DATABASE
wp db export local.sql
wp @prod db export - > prod.sql
wp db reset --yes
wp db import prod.sql
wp search-replace <prod_url> <local_url> 

--precise --recurse-objects --skip-columns=guid 

--skip-tables=wp_users
MAINTENANCE
UPDATE WORDPRESS CORE
wp core update
wp core update-db
UPDATE PLUGINS
wp plugin update wordpress-seo
wp plugin update --all
DELETE PLUGINS
wp plugin deactivate wordpress-seo
wp plugin delete wordpress-seo
wp plugin deactivate wordpress-seo --uninstall
BULK IMPORT MEDIA
wp media import images_folder/*
REGENERATING THUMBNAILS
wp media regenerate --only-missing
DATABASE MANAGEMENT
wp db export
wp db repair
wp db optimize
RESOURCES
RESOURCES
‣ https://make.wordpress.org/cli/handbook/installing/
‣ https://make.wordpress.org/cli/handbook/
‣ https://developer.wordpress.org/cli/commands/
‣ https://make.wordpress.org/cli/handbook/config/
‣ https://make.wordpress.org/cli/handbook/hosting-companies/
‣ http://wp-cli.org/
‣ http://wp-cli.org/package-index/
‣ http://wp-cli.org/restful/
WP-CLI FOR THE WIN!
MICAH WOOD
HTTPS://WPSCHOLAR.COM
@WPSCHOLAR

Contenu connexe

Tendances

Editing Wordpress in Dreamweaver
Editing Wordpress in DreamweaverEditing Wordpress in Dreamweaver
Editing Wordpress in Dreamweaver
Garin Kilpatrick
 

Tendances (20)

Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLICommand Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
 
Editing Wordpress in Dreamweaver
Editing Wordpress in DreamweaverEditing Wordpress in Dreamweaver
Editing Wordpress in Dreamweaver
 
Ctrl+F5 Bangalore 2017: Super charge you word press website by Justin Thomas
Ctrl+F5 Bangalore 2017: Super charge you word press website by Justin ThomasCtrl+F5 Bangalore 2017: Super charge you word press website by Justin Thomas
Ctrl+F5 Bangalore 2017: Super charge you word press website by Justin Thomas
 
Creating a
Creating a Creating a
Creating a
 
WordPress Multilingual: WordCamp Antwerp 2016
WordPress Multilingual: WordCamp Antwerp 2016WordPress Multilingual: WordCamp Antwerp 2016
WordPress Multilingual: WordCamp Antwerp 2016
 
Don't Over-React - just use Vue!
Don't Over-React - just use Vue!Don't Over-React - just use Vue!
Don't Over-React - just use Vue!
 
Blackberry
BlackberryBlackberry
Blackberry
 
Wordpress
WordpressWordpress
Wordpress
 
Jaggery Introductory Webinar
Jaggery Introductory WebinarJaggery Introductory Webinar
Jaggery Introductory Webinar
 
Weebly login
Weebly loginWeebly login
Weebly login
 
How to Install WordPress 2014 in cPanel
How to Install WordPress 2014 in cPanelHow to Install WordPress 2014 in cPanel
How to Install WordPress 2014 in cPanel
 
Wordpress vs Google Blogger/ Wampserver
Wordpress vs Google Blogger/ WampserverWordpress vs Google Blogger/ Wampserver
Wordpress vs Google Blogger/ Wampserver
 
How to prevent gradual loading of css in WordPress
How to prevent gradual loading of css in WordPressHow to prevent gradual loading of css in WordPress
How to prevent gradual loading of css in WordPress
 
Creating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPressCreating SmartPhone Apps Using WordPress
Creating SmartPhone Apps Using WordPress
 
Working in harmony
Working in harmonyWorking in harmony
Working in harmony
 
Building Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps EngineBuilding Your WordPress Website Using Google Apps Engine
Building Your WordPress Website Using Google Apps Engine
 
Leeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website SpeedLeeward WordPress Meetup- Caching and Website Speed
Leeward WordPress Meetup- Caching and Website Speed
 
Headless drupal
Headless drupalHeadless drupal
Headless drupal
 
How to install wordpress
How to install wordpressHow to install wordpress
How to install wordpress
 
Library 2.0 : Weblogs : Wordpress
Library 2.0 : Weblogs : WordpressLibrary 2.0 : Weblogs : Wordpress
Library 2.0 : Weblogs : Wordpress
 

Similaire à WP-CLI For The Win

Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your Showcases
Jun Hu
 

Similaire à WP-CLI For The Win (20)

Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
Gestione avanzata di WordPress con WP-CLI - WordCamp Torino 2017 - Andrea Car...
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
Administer WordPress with WP-CLI
Administer WordPress with WP-CLIAdminister WordPress with WP-CLI
Administer WordPress with WP-CLI
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
WP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of DeveloperWP-CLI - A Good Friend of Developer
WP-CLI - A Good Friend of Developer
 
WordPress and The Command Line
WordPress and The Command LineWordPress and The Command Line
WordPress and The Command Line
 
Developers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLIDevelopers, Be a Bada$$ with WP-CLI
Developers, Be a Bada$$ with WP-CLI
 
Take Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long BeachTake Command of WordPress With WP-CLI at WordCamp Long Beach
Take Command of WordPress With WP-CLI at WordCamp Long Beach
 
Introduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command lineIntroduction to WP-CLI: Manage WordPress from the command line
Introduction to WP-CLI: Manage WordPress from the command line
 
Theming Wordpress for Your Showcases
Theming Wordpress for Your ShowcasesTheming Wordpress for Your Showcases
Theming Wordpress for Your Showcases
 
Workshop On WP-CLI
Workshop On WP-CLIWorkshop On WP-CLI
Workshop On WP-CLI
 
Advanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.comAdvanced WordPress Tooling: By InstaWP.com
Advanced WordPress Tooling: By InstaWP.com
 
Take Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLITake Command of WordPress With WP-CLI
Take Command of WordPress With WP-CLI
 
Remote Control WordPress
Remote Control WordPressRemote Control WordPress
Remote Control WordPress
 
Session: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from ScratchSession: WP Site Management using WP-CLI from Scratch
Session: WP Site Management using WP-CLI from Scratch
 
The Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/PressThe Enterprise Wor/d/thy/Press
The Enterprise Wor/d/thy/Press
 
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cliWordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
WordCamp Vancouver 2012 - Manage WordPress with Awesome using wp-cli
 
Word press, the automated way
Word press, the automated wayWord press, the automated way
Word press, the automated way
 
Improving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP ProfilingImproving WordPress Performance with Xdebug and PHP Profiling
Improving WordPress Performance with Xdebug and PHP Profiling
 
Faster WordPress Workflows
Faster WordPress WorkflowsFaster WordPress Workflows
Faster WordPress Workflows
 

Plus de Micah Wood

Plus de Micah Wood (18)

Introduction to JSX
Introduction to JSXIntroduction to JSX
Introduction to JSX
 
Using Chrome Dev Tools
Using Chrome Dev ToolsUsing Chrome Dev Tools
Using Chrome Dev Tools
 
Shortcodes In-Depth
Shortcodes In-DepthShortcodes In-Depth
Shortcodes In-Depth
 
Becoming a WordPress Coding Master
Becoming a WordPress Coding MasterBecoming a WordPress Coding Master
Becoming a WordPress Coding Master
 
Debugging in PHP
Debugging in PHPDebugging in PHP
Debugging in PHP
 
WordPress Hooks
WordPress HooksWordPress Hooks
WordPress Hooks
 
The Modern JavaScript Developers Toolbox
The Modern JavaScript Developers ToolboxThe Modern JavaScript Developers Toolbox
The Modern JavaScript Developers Toolbox
 
Using Composer with WordPress
Using Composer with WordPressUsing Composer with WordPress
Using Composer with WordPress
 
An Introduction to PHP Classes
An Introduction to PHP ClassesAn Introduction to PHP Classes
An Introduction to PHP Classes
 
Backbone + React
Backbone + ReactBackbone + React
Backbone + React
 
Advanced Development Workflows
Advanced Development WorkflowsAdvanced Development Workflows
Advanced Development Workflows
 
Testing Made Easy
Testing Made EasyTesting Made Easy
Testing Made Easy
 
Debugging in PHP
Debugging in PHPDebugging in PHP
Debugging in PHP
 
Troubleshooting WordPress Issues
Troubleshooting WordPress IssuesTroubleshooting WordPress Issues
Troubleshooting WordPress Issues
 
Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0Using Composer with WordPress - 2.0
Using Composer with WordPress - 2.0
 
Using composer with WordPress
Using composer with WordPressUsing composer with WordPress
Using composer with WordPress
 
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and PluginsSanitizing, Validating and Escaping in WordPress Themes and Plugins
Sanitizing, Validating and Escaping in WordPress Themes and Plugins
 
Getting Started with Vagrant
Getting Started with VagrantGetting Started with Vagrant
Getting Started with Vagrant
 

Dernier

Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
Joaquim Jorge
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
Enterprise Knowledge
 

Dernier (20)

Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law DevelopmentsTrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
TrustArc Webinar - Stay Ahead of US State Data Privacy Law Developments
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
04-2024-HHUG-Sales-and-Marketing-Alignment.pptx
 
Exploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone ProcessorsExploring the Future Potential of AI-Enabled Smartphone Processors
Exploring the Future Potential of AI-Enabled Smartphone Processors
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men08448380779 Call Girls In Greater Kailash - I Women Seeking Men
08448380779 Call Girls In Greater Kailash - I Women Seeking Men
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
Bajaj Allianz Life Insurance Company - Insurer Innovation Award 2024
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
Apidays Singapore 2024 - Building Digital Trust in a Digital Economy by Veron...
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)Powerful Google developer tools for immediate impact! (2023-24 C)
Powerful Google developer tools for immediate impact! (2023-24 C)
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
08448380779 Call Girls In Diplomatic Enclave Women Seeking Men
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 

WP-CLI For The Win