Checks if WP-CLI is due for an update.

#wordpress#cli
wp cli check-update
copy

Return WP CLI version.

#wordpress#cli
wp cli version
copy

Creates config.php file. Requires mysql cli to be installed.

#wordpress#cli
wp config create --dbname=yourdbname --dbuser=root --prompt=dbpassword
copy

Download latest version of WordPress core files to current directory.

#wordpress#cli
wp core download
copy

Opens wp-config.php file in the default text editor.

#wordpress#cli
wp config edit
copy

Exports WXR file containing XML formatted data about your site including posts, comments and information about images and other attachments. Site option settings are excluded.

#wordpress#cli
wp cli export
copy

This command will generate authentication unique keys and salts in your wp-config.php file.

#wordpress#cli#config
wp config shuffle-salts
copy

Install a plugin in your WordPress site. By passing --activate flag you can enable your new plugin in one command.

#wordpress#cli
wp plugin install [pluginhandle] --activate
copy

Puts your site in a maintenance mode and returns "Briefly unavailable for scheduled maintenance. Check back in a minute." message with a 503 server response.

#wordpress#cli
wp maintenance-mode activate
copy

Takes your site out of maintenance mode.

#wordpress#cli
wp maintenance-mode deactivate
copy

Returns maintenance mode status of your site.

#wordpress#cli
wp maintenance-mode status
copy

Regenerate all thumbnail image sizes stored in the media library. The --yes flag confirms your choice.

#wordpress#cli
wp media regenerate --yes
copy

This command will generate basic files and structure for a new plugin. Use --skip-tests flag to omit php unit tests in the process.

#wordpress#cli#plugin
wp scaffold plugin your-plugin-slug
copy

Generates un-styled main theme with all the necessary files and views to display content.

#wordpress#cli
wp scaffold _s your-theme-slug --theme_name="Theme Name" --author="Your Name"
copy

Updates all installed plugins.

#wordpress#cli
wp plugin update --all
copy

Update WP-CLI to the latest version.

#wordpress#cli
wp cli update
copy

Prints information to the console about WP CLI and its environment such as version, OS, PHP, MySQL.

#wordpress#cli
wp cli info
copy
NordVPN NordVPN