WP CLI

Installation

Homepage

1
2
3
4
5
6
sudo bash
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
mv wp-cli.phar /usr/bin/wp
chmod +x /usr/bin/wp
cd "your-wordpress-directory"
wp --info

Use Cases

Change Base URL

Wordpress stores the base url in more than one place, meaning it needs to be changed globally across multiple tables.

1
wp search-replace 'www.current.com' 'www.new.com' --skip-columns=guid