Adv WP CLI

Eba4cc68bfbc2b59c3c3a3cf789075f0?s=47 Tom J Nowell
September 23, 2014

Adv WP CLI

Advanced WP CLI talk for WP Leeds dev night

Eba4cc68bfbc2b59c3c3a3cf789075f0?s=128

Tom J Nowell

September 23, 2014
Tweet

Transcript

  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

    users
  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

    --fields=name
  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