Your SlideShare is downloading. ×
0
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Command Line WordPress with WP-CLI
Upcoming SlideShare
Loading in...5
×

Thanks for flagging this SlideShare!

Oops! An error has occurred.

×
Saving this for later? Get the SlideShare app to save on your phone or tablet. Read anywhere, anytime – even offline.
Text the download link to your phone
Standard text messaging rates apply

Command Line WordPress with WP-CLI

12,721

Published on

How to use WP-CLI to manage your WordPress Installations. Using WP-CLI you can: …

How to use WP-CLI to manage your WordPress Installations. Using WP-CLI you can:
Install WordPress, update WordPress, install plugins, update plugins, database search and replace, create test posts and pages, create new plugins, manage comments, manage users, perform database imports/exports, and more.

A presentation given that the WordPress Melbourne User Group September 2013 Meetup (http://www.meetup.com/WordPress-Melbourne/events/112574042/).

Published in: Technology, Business
0 Comments
1 Like
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total Views
12,721
On Slideshare
0
From Embeds
0
Number of Embeds
4
Actions
Shares
0
Downloads
3
Comments
0
Likes
1
Embeds 0
No embeds

Report content
Flagged as inappropriate Flag as inappropriate
Flag as inappropriate

Select your reason for flagging this presentation as inappropriate.

Cancel
No notes for slide

Transcript

  • 1. Command Line WordPress with WP-CLI James Collins @om4james http://jamesc.id.au/ WordPress Melbourne User Group - September 2013
  • 2. What is WP-CLI? A command line tool for managing WordPress installations Uses the command line (not a web browser) http://wp-cli.org/ 2
  • 3. Why? (Usually) faster than using a mouse Powerful - automate/script common tasks Useful when managing lots of WordPress installations (including Multisite) Active project with over 60 contributors 3
  • 4. Usage Install WP-CLI once on your computer/server Navigate to a WordPress install: cd /path/to/wordpress/install/ Run the ‘wp’ command: wp 4
  • 5. What Can It Do? 5
  • 6. WordPress Core Update WordPress core: wp core update Upgrade WordPress database: wp core update-db 6
  • 7. WordPress Plugins Update all plugins: wp plugin update-all List all plugins: wp plugin status I = Inactive, A = Active, M = Must Use, U = Update Available 7
  • 8. WordPress Plugins (cont.) Install a plugin from WordPress.org: wp plugin install facebook Activate a plugin: wp plugin activate facebook or: wp plugin install --activate facebook 8
  • 9. WordPress Themes Update all themes: wp theme update-all List all themes: wp theme status I = Inactive, A = Active, U = Update Available 9
  • 10. WordPress Themes (cont.) Install a theme from WordPress.org: wp plugin install quark Activate a theme: wp theme activate quark or: wp theme install --activate quark 10
  • 11. Update Everything! Update WordPress, plugins & themes: wp core update && wp plugin update-all && wp theme update-all Use this in a daily cron job (if you dare) 11
  • 12. Database Search/Replace Search/replace in all tables in the database Will correctly handle serialized values Useful when changing domain names wp search-replace 'http://example.dev' 'http://example.com' --dry-run 12
  • 13. WordPress Media/Uploads Regenerate/recreate WordPress thumbnails: wp media regenerate Useful after changing image size settings, or switching themes 13
  • 14. Create Posts Create 100 posts: wp post generate --count=100 14
  • 15. Create Pages Create 100 pages, 3 levels deep: wp post generate --count=100 --post_type=page --max_depth=3 15
  • 16. Create New Plugin Create a new (empty) plugin and activate it: wp scaffold plugin myplugin -- plugin_name='My Plugin' --activate Useful when developing a new plugin 16
  • 17. Download & Install WordPress cd /path/to/empty/directory/ wp core download wp core config --dbname=wpcli -- dbuser=wpcli --dbpass=wpcli wp core install 17
  • 18. Also: Add/manage comments Add/manage users Database import/export Change WordPress options Heaps more! 18
  • 19. Questions? http://wp-cli.org/ https://github.com/wp-cli/wp-cli These slides are online at: http://jamesc.id.au/wp-cli/ 19

×