WP-CLI » Create WP-CLI Aliases

Create WP-CLI Aliases

IF you use the same commands often you can save them as aliases so that you have them always available.

For example, the following commands will check if WP core, installed plugins and themes have updates available:

wp core check-update
wp plugin list --update=available
wp theme list --update=available

You can combine the commands into a one-liner:

wp core check-update && wp plugin list --update=available && wp theme list --update=available
image 3 - Create WP-CLI Aliases

and you can create an alias for this command:

alias check-all='wp core check-update && wp plugin list --update=available && wp theme list --update=available'

so you can simply run: check-all

image 4 - Create WP-CLI Aliases

This will create an alias for the current shell session, meaning that when you log in next time and want to use the command check-all it will not recognize it.

image 5 - Create WP-CLI Aliases
See also  How to disable 🇷🇸 Serbian Cyrillic characters on WooCommerce checkout page

To save an alias for future use add it to your ~/.bashrc or ~/.zshrc  file.

Was this post helpful?

Leave a Comment

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.

Recommended