Upgrade to Pro — share decks privately, control downloads, hide ads and more …


Tom J Nowell
September 23, 2014


Advanced WP CLI talk for WP Leeds dev night

Tom J Nowell

September 23, 2014

More Decks by Tom J Nowell

Other Decks in Technology


  1. Advanced WP CLI A WPLeeds talk by Tom J Nowell

  2. I’m Tom J Nowell Code For The People

  3. I’ll Cover • What is WP CLI • Some WP

    CLI Commands & Usage • Demo
  4. WP CLI WordPress, Command Line Interface A tool for terminal

  5. What is The Terminal?

  6. None
  7. Once installed, open your WordPress folder on the terminal GIF

    by Chris Coyier of CSS Tricks
  8. Some of the Things WP CLI Can Do • Create

    Posts • Create Users • Download plugins and themes • Database Queries • Installing WordPress
  9. E.g. Adding an author to a site: ❯ wp user

    create bob bob@example.com --role=author
  10. Listing activated plugins ❯ wp plugin list --status=active -- format=csv

  11. Doing a Search replace ❯ wp search-replace oldsite.com newsite.com

  12. List blogs, and their URLs in a multisite ❯ blogs=$(wp

    site list --fields="site_id, blog_id,url" --format="csv") for entry in $blogs do site_id=$(echo $entry |cut -d ',' -f1 ) blog_id=$(echo $entry |cut -d ',' -f2 ) blog_url=$(echo $entry |cut -d ',' -f3 ) echo "$blog_id: $blog_url in $site_id" done
  13. A demonstration

  14. Questions? Tom J Nowell @tarendai tomjn.com