Let's Find You the Perfect Managed Hosting Plan.
Answer a few questions, and we'll present you with a personalized tour of the Cloudways platform based on your answers.
In this tutorial, we’ll walk you through managing your WordPress websites using WP-CLI on the Cloudways platform. WP-CLI lets you update plugins, manage themes, and run database queries directly from the server, making site management more efficient.You’ll learn key commands to handle plugin updates, WordPress core updates, post creation, and more.Listed here are commonly used commands: To Navigate to the public_html folder of your application cd applications/application_folder_name/public_html List all installed plugins: wp plugin list Activate a specific plugin: wp plugin activate plugin-name Install a plugin: wp plugin install plugin-name Deactivate a plugin: wp plugin deactivate plugin-name Update a plugin: wp plugin update plugin-name Update all your plugins at once: wp plugin update –all Check the current WordPress version: wp core version Update your WordPress site to the latest version: wp core update Refresh the terminal screen: clear Create a new post with a title: wp post create –post_title=”Your Post Title” –post_status=publish See list of all posts on your site: wp post list List all registered on your WordPress site: wp user list Export your database into a SQL file: wp db export Reset a user’s password: wp user update username –user_pass=newpassword Retrieve the value of a WordPress option: wp option get Update a WordPress option: wp option update Import a database from a SQL file: wp db import filename.sql Discover more commands or get more help: wp help Or wp
Welcome to Cloudways. This tutorial will show you how to manage your WordPress site using WPCLI on the Cloudways platform WPCLI is short for WordPress Command Line Interface. It is a powerful command line tool that allows you to manage your WordPress installation directly from your server, using SSH without having to navigate through the WordPress dashboard. It enables you to perform a wide range of tasks such as updating plugins, managing themes, running database queries, and more SSH Connection to establish an SSH connection to your server. Here we are showing how to build the SSH connection on Mac. If you use windows, you may check the video linked here to learn how to build a SSH connection to your WordPress application. Now let’s navigate to our server and open an SSH client. In this case, we’ll use the terminal. Begin by typing ssh followed by your master username. After the username, add the @ symbol followed by the server’s IP address. You can easily copy these from the platform. Once you’re connected, let’s start managing WordPress using WPCLI. Now you need to navigate to the Public_HTML folder of your application by using this command. To find your application folder name, navigate to your desired application and copy the folder name from Application Settings and replace the application_folder_name with your application folder name. Managing WordPress Plugins Managing WordPress plugins with WPCLI WPCLI makes managing plugins incredibly simple to list all installed plugins type command. To activate a specific plugin, use command. To install a plugin, it is important to have the correct plugin name or more specifically plugin slug. You can find this slug in the WordPress plugin repository. For example, if you’re looking to install Breeze, head over to the WordPress official website. Type breeze in the search box, select your plugin. The last part of the URL is the plugin slug. The slug here is breeze, so to install this plugin using WPCLI you would type the command. Here’s a few more commands to help you manage plugins. To deactivate a plugin. To update a plugin and to update all your plugins at once. These work well for all the plugins and make plugin management quick and efficient through the command line checking version Updating WordPress Core and updating WordPress core, it’s essential to keep your WordPress core up to date for security and performance. You can quickly check your current WordPress version with the command. You can quickly update your WordPress site to the latest version using the command. With just these simple commands, you ensure your WordPress site is running smoothly and securely. If your terminal gets cluttered with too many commands or outputs, making it hard to navigate, you can use the clear command to refresh the terminal screen. This helps in maintaining a clean workspace, especially when you’re running multiple commands in succession. Commonly used WPCLI commands. Commonly used WPCLI commands WPCLI isn’t just limited to plugins and updates. You can use some other commonly used commands that can help you manage your site effectively. To create a new post with a title and publish it immediately, simply run. If you want to see a list of all posts on your site, including their status and post type, use the command. You can also list all users registered on your WordPress site by typing the command. WPCLI also allows you to export your database into a SQL file. To do that, use the command. Similarly, the other useful commands are to reset a user’s password easily. To retrieve the value of a WordPress option, for example, the site name you can use. To update a WordPress option, such as changing the blog name, type the following. If you need to import a database from a SQL file, use the command. To discover more commands and options, you can type the following commands to get more help. The link for the WPCLI official documentation to get more help navigating WPCLI and its functionality is given in the description. That’s it for this tutorial. If you have any questions, feel free to check out the Cloudways knowledge base or reach out to our support team.
Answer a few questions, and we'll present you with a personalized tour of the Cloudways platform based on your answers.