WordPress core — WP-CLI guide for a manual WordPress update

Posted on by Haritha Jacob | Updated:
Reading Time: 7 minutes

In the world of websites, keeping things fresh is a big deal. If you run a WordPress website, it has a central engine called the "WordPress core" that needs regular updates to run smoothly and stay secure. While there's an automatic update option, some of us want a bit more say in how things are done. That's where WP-CLI (WordPress Command Line Interface) comes in handy. Think of it as your tool for giving your website the exact care it needs.

This guide is like a map for your journey into manual WordPress updates via the user-friendly WP-CLI. Whether you're a tech pro or just someone who loves their website, we will make this process simple and empowering. Let's explore the ins and outs of updating your WordPress core with WP-CLI. We're not just keeping up but leading the way in this digital adventure!

Knowing the various WordPress update options

Maintaining your WordPress website is like giving your car routine maintenance — it ensures smooth performance, fixes any underlying issues, and enhances security. WordPress, being a dynamic platform, offers various update options to support differing user preferences and needs. In this comprehensive overview, we'll delve into the diverse ways you can keep your WordPress site up-to-date, exploring both automatic and manual methods.

Before we delve into the intricacies of a manual update, let's take a moment to understand the available WordPress update options. WordPress offers automatic updates, providing a hands-off approach to keeping your site current. However, for users who desire more control and customization over the update process, a manual update using WP-CLI becomes an invaluable method that is available to admin users.

Automatic WordPress updates — set them and forget them

Background updates

WordPress introduced automatic background updates to ensure your site stays current with minimal effort. By default, minor updates like security patches are automatically applied, sparing you the hassle of manual intervention. This "set it and forget it" approach is ideal for users who prioritize convenience and want their sites to be automatically fortified against potential vulnerabilities.

Core, plugins, and themes

Automatic updates extend beyond the core WordPress software to include plugins and themes. For security plugins or essential themes, having the latest versions is crucial. Automatic updates for these components save time and reduce the risk of security breaches or compatibility issues.

Configuring automatic updates

Within the WordPress dashboard, users can configure automatic updates based on their preferences. Whether limiting updates to only minor releases or enabling automatic updates for everything, users can tailor the process to align with their specific needs.

Manual WordPress core, plugin, and theme updates — take hands-on control

User-initiated core updates

While automatic updates are convenient, some users prefer a more hands-on approach to core updates. Manually initiating core updates allows users to schedule the process at a time that suits them, ensuring minimal disruption to their website's operations.

Controlled plugin and theme updates

Manual control extends to plugins and themes. Website owners can carefully select which plugins and themes to update — reviewing release notes and ensuring compatibility with their existing setup before making any changes. This level of control is especially valuable for users who have customized themes or rely on specific plugins for critical functionalities.

Staging environments for testing

Large-scale websites, especially those with intricate configurations, often employ staging environments. These are duplicate versions of the live site where updates can be tested before being applied to the main website. Staging environments provide a controlled space to identify and address any potential conflicts or issues arising from updates.

Leveraging WP-CLI for manual WordPress core, plugin, and theme updates

WP-CLI — command-line power

For users comfortable with the command line, WP-CLI (WordPress Command Line Interface) is a game-changer. This powerful tool allows users to manage various aspects of their WordPress site directly through the terminal or command prompt. From updating the core to managing plugins and themes, WP-CLI provides a faster and more efficient alternative to traditional web user interface methods.

Connecting website owners to the terminal

WP-CLI connects website owners directly to the heart of their site — the server. This direct line of communication enables swift updates without the need for graphical interfaces. While this method may seem intimidating for beginners, it offers unparalleled efficiency for those familiar with the command line.

Efficient version control

WP-CLI doesn't just update the WordPress core. It's a comprehensive tool for managing the entire ecosystem. Users can update plugins, themes, and even perform database operations seamlessly. This efficiency is particularly beneficial for website owners handling multiple sites or developers managing client websites.

WordPress updates via WP-CLI — step-by-step guide

While the prospect of a manual update might seem intimidating, utilizing WP-CLI makes the process efficient and straightforward. The WP-CLI lets users to manage various aspects of their WordPress site directly from the terminal.

For those comfortable with the command line and seeking the utmost efficiency, WP-CLI is a compelling choice. It streamlines the update process and offers robust tools for managing various aspects of a WordPress site. As with any tool, familiarity and understanding are vital to harnessing its full potential. To manually update your WordPress core using WP-CLI, follow these comprehensive steps below.

Preparing for change with a website backup

Before embarking on any major changes to your website, it's essential to create a safety net — a backup that ensures you're covered in case anything unexpected happens. This step is non-negotiable and serves as a precautionary measure throughout the WordPress update process.

To make a full backup of your website, consider using your hosting provider's client portal. A "comprehensive and full" website backup option ensures that all aspects of your site, from content to configurations, are securely stored.

Update WordPress core — step-by-step guide

Step #1. Access your server's command line

Before initiating the update, establish a connection to your server via SSH to gain access to the command line. If you're unfamiliar with SSH, we provide a beginner-friendly guide.

Step #2. Navigate to your WordPress installation directory

Use the cd command to move to your WordPress installation's directory. Here is a an example:

cd /path/to/your/wordpress

Example: cd /home/a6798cb3/4d6d761b08.nxcli.io/html

Step #3. Check the current WordPress version

It's essential to know your current WordPress version before proceeding with the update. Execute the following command:

wp core version

Example: [a6798cb3@cloudhost-7138212 html]$ wp core version
6.3.2

Step #4. Initiate the WordPress core update

Use the following WP-CLI command to update your WordPress core:

wp core update --version=X.X.X

Example: [a6798cb3@cloudhost-7138212 html]$ wp core update --version=6.4.1
Updating to version 6.4.1 (en_US)...
Downloading update from https://wordpress.org/wordpress-6.4.1.zip...
Unpacking the update...
Cleaning up files...
No files found that need cleaning up.
Success: WordPress updated successfully.

Replace X.X.X with the desired version number.

After updating the core, the next step involves checking and updating the database if necessary. WordPress often includes database schema changes with new releases. To ensure your site functions seamlessly with the updated core, run the following command:

wp core update-db

This command checks and updates the WordPress database to match the current version. It's a critical step to ensure compatibility and avoid any potential issues with your site's functionality.

Step #5. Verify the update

Confirm the successful update by rechecking the WordPress version:

wp core version

Example: [a6798cb3@cloudhost-7138212 html]$ wp core version
6.4.1

Update a WordPress plugin — step-by-step guide

Plugins are like the tools that make your website work better. But just like tools need regular maintenance, so do your plugins. If they get too old, they might not work well and could even cause some problems.

Step #1. Initiate the update of all plugins

To make sure all your plugins are up-to-date, use this command:

wp plugin update --all

Example: [a6798cb3@cloudhost-7138212 html]$ wp plugin update --all
Downloading update from https://downloads.wordpress.org/plugin/akismet.5.3.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
Downloading update from https://downloads.wordpress.org/plugin/wpforms-lite.1.8.4.1.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the plugin...
Plugin updated successfully.
+--------------+-------------+-------------+---------+
| name         | old_version | new_version | status  |
+--------------+-------------+-------------+---------+
| akismet      | 5.2         | 5.3         | Updated |
| wpforms-lite | 1.8.3.1     | 1.8.4.1     | Updated |
+--------------+-------------+-------------+---------+
Success: Updated 2 of 2 plugins.

Step #2. Verify that all plugins are working as expected

This command is like giving your website a tune-up. It updates all your plugins in one batch, making sure everything runs smoothly and stays secure. It's a quick way to ensure your website has all the latest improvements without spending too much time on each plugin.

Update a WordPress Theme — step-by-step guide

Your website has a particular style, and themes are like the clothes it wears. Just like you'd update your wardrobe, updating your themes is a good idea. Old themes might not look good or could even cause some issues.

Step #1. Initiate the update of all themes

To update all your themes, use this command:

wp theme update --all

Example: [a6798cb3@cloudhost-7138212 html]$ wp theme update --all
Enabling Maintenance mode...
Downloading update from https://downloads.wordpress.org/theme/kadence.1.1.49.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://downloads.wordpress.org/theme/twentytwentyone.2.0.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://downloads.wordpress.org/theme/twentytwentythree.1.3.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Downloading update from https://downloads.wordpress.org/theme/twentytwentytwo.1.6.zip...
Unpacking the update...
Installing the latest version...
Removing the old version of the theme...
Theme updated successfully.
Disabling Maintenance mode...
+-------------------+-------------+-------------+---------+
| name              | old_version | new_version | status  |
+-------------------+-------------+-------------+---------+
| kadence           | 1.1.43      | 1.1.49      | Updated |
| twentytwentyone   | 1.8         | 2.0         | Updated |
| twentytwentythree | 1.2         | 1.3         | Updated |
| twentytwentytwo   | 1.4         | 1.6         | Updated |
+-------------------+-------------+-------------+---------+
Success: Updated 4 of 4 themes.

Step #2. Verify that all themes are working as expected

This command is like giving your website a fresh look. It updates all the themes simultaneously, ensuring your website looks good and works well. It's an easy way to stay stylish and avoid any problems with outdated themes.

Bottom line

Opting for a manual WordPress update through WP-CLI commands gives website owners control over their site's WordPress core directly from the command line. Whether managing a single website or multiple installations, this approach offers efficiency and customization.

It's crucial to note that while WP-CLI provides powerful control, it doesn't necessarily offer more control than the WordPress dashboard (wp-admin). Instead, it offers an alternative method, allowing users to perform the same actions through the command line. The strength of WP-CLI lies in its flexibility and efficiency, enabling users to manage their WordPress sites with ease and precision, mirroring the capabilities available in wp-admin.

For those looking to dive deeper into managing their WordPress site, check out the beginner's guide to managed WordPress from Liquid Web. And if you're just starting out, Liquid Web has a helpful guide on installing WordPress to get you up and running smoothly.

By staying informed and leveraging tools like WP-CLI, you empower yourself to maintain a secure and optimized WordPress site. Keep your WordPress core updated and explore the possibilities with Liquid Web's hosting solutions. Your website's success starts with a strong foundation — let Liquid Web be your partner on that journey.

As you embark on your WordPress journey, consider the hosting solutions offered by Liquid Web. Our managed WordPress hosting ensures a seamless experience that will enable you to concentrate on your website's content and growth. Explore our hosted WordPress plans here and take the first step toward a hosting provider dedicated to your success.

Avatar for Haritha Jacob

About the Author: Haritha Jacob

Latest Articles

In-place CentOS 7 upgrades

Read Article

How to use kill commands in Linux

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change cPanel password from WebHost Manager (WHM)

Read Article

Change the root password in WebHost Manager (WHM)

Read Article