WP-CLI is a command-line interface for managing WordPress sites. It allows you to perform various administrative tasks from the command line. Follow these steps to use WP-CLI:
wp --version
to check the installed version of WP-CLI.wp user create username [email protected] --role=author
to create a new user.Do to the read-only file system, you cannot run all commands. You can you use functions in the dashboard to achieve same commands.
wp theme install theme-slug
to install a theme.wp theme activate theme-slug
to activate a theme.wp theme update theme-slug
to update a theme.wp core update
to update WordPress core to the latest version.wp plugin install plugin-slug
to install a plugin.wp plugin activate plugin-slug
to activate a plugin.wp plugin update plugin-slug
to update a plugin.wp post create --post_title="Post Title" --post_content="Post content." --post_status=publish
to create a new post.wp post list
to list all posts.wp post delete post-id
to delete a post.wp help
command to get help with WP-CLI commands and options.