Skip to content

How do I enable the WordPress CLI (WP-CLI) on my hosting account?

You can install WP-CLI on any hosting plan by connecting via SSH and running the following commands:

Terminal window
# Download WP-CLI
curl -O https://raw.githubusercontent.com/wp-cli/builds/gh-pages/phar/wp-cli.phar
# Make it executable
chmod +x wp-cli.phar
# Create a bash alias
alias wp='~/wp-cli.phar'
# Make the alias permanent
echo "alias wp='~/wp-cli.phar'" >> ~/.bashrc
# Reload your shell configuration
source ~/.bashrc

You can now navigate to your WordPress installation directory and use the wp command.

For help connecting via SSH, see How do I log into SSH?.