Home

WP-CLI

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:

Access WP-CLI

  • WP CLI: WP-CLI is available on our dashboard under Manage site.
  • Basic Commands

  • Check Version: Run wp --version to check the installed version of WP-CLI.
  • Create User: Run wp user create username [email protected] --role=author to create a new user.
  • Command not available on Trustdoms WP_CLI

    Do to the read-only file system, you cannot run all commands. You can you use functions in the dashboard to achieve same commands.

  • Install Theme: Run wp theme install theme-slug to install a theme.
  • Activate Theme: Run wp theme activate theme-slug to activate a theme.
  • Update Theme: Run wp theme update theme-slug to update a theme.
  • Update Core: Run wp core update to update WordPress core to the latest version.
  • Install Plugin: Run wp plugin install plugin-slug to install a plugin.
  • Activate Plugin: Run wp plugin activate plugin-slug to activate a plugin.
  • Update Plugin: Run wp plugin update plugin-slug to update a plugin.
  • Manage Posts

  • Create Post: Run wp post create --post_title="Post Title" --post_content="Post content." --post_status=publish to create a new post.
  • List Posts: Run wp post list to list all posts.
  • Delete Post: Run wp post delete post-id to delete a post.
  • Best Practices

    • Use Help: Use the wp help command to get help with WP-CLI commands and options.