Last active
October 7, 2019 12:26
-
-
Save jpen365/088da8094620057e5068435ef93e34d9 to your computer and use it in GitHub Desktop.
Things you can do with wp-cli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp core config --dbname=database_name --dbuser=database_user --dbpass=user_password --dbhost=localhost --dbprefix=wp_ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp core download |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp core install --url=example.com --title=Website-Name --admin_user=Unique_User --admin_password=$tron9Pa55w0rd --admin_email=email@example.com |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp core update --version=4.6.1 --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Deactivate a plugin | |
wp plugin deactivate hello-dolly | |
# Deactivate and uninstall a plugin | |
wp plugin deactivate hello-dolly --uninstall | |
# Uninstall a previously deactivated plugin | |
wp plugin uninstall hello-dolly | |
# Deactivate all plugins | |
wp plugin deactivate --all | |
# Force plugin to a previous version after bad update | |
wp plugin install hello-dolly --version=1.5 --force |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp plugin install wp-smushit custom-sidebars |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp plugin list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp plugin search smush |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for plugin updates | |
wp plugin list | |
# Check which plugins WP-CLI can update | |
wp plugin update --all --dry-run | |
# Update all plugins | |
wp plugin update --all | |
# Update a single plugin | |
wp plugin update smushit |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Search and replace a custom table and core table | |
wp search-replace "old-string" "new-string" wp_custom_table wp_posts | |
# Search and replace all tables, including custom tables | |
wp search-replace "old-string" "new-string" --all-tables |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check number of times string will be replaced | |
wp search-replace "http://olddomain.com" "http://newdomain" --dry-run | |
# Replace old domain with new domain | |
wp search-replace "http://olddomain.com" "http://newdomain.com" | |
# Update URL to https | |
wp search-replace "http://example.com" "https://example.com" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Activate a theme | |
wp theme activate twentyseventeen | |
# Delete a deactivated theme | |
wp theme delete twentysixteen | |
# Disable a theme on a multisite network | |
wp theme disable twentysixteen | |
# Enable a theme on a multisite network | |
wp theme enable twentyseventeen |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Install Tortuga from WordPress.org (https://wordpress.org/themes/tortuga/) | |
wp theme install tortuga | |
# Install a Theme Store Locally | |
wp theme install ../tortuga.zip | |
# Install a Theme Stored Remotely | |
wp theme install https://github.com/jpen365/five-hacks-for-twenty-seventeen/archive/1.0.zip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
wp theme list |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Check for theme updates | |
wp theme list | |
# Check which themes WP-CLI can update | |
wp theme update --all --dry-run | |
# Update all themes | |
wp theme update --all | |
# Update one theme | |
wp theme update twentyseventeen |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment