How (And When) to Clear the Cache in WordPress

WordPress caching is essential to improve your website’s performance and serve your pages quickly to your users. However, after making changes to your site, your cached content can prevent you and your visitors from seeing these updates. Therefore, you might be asking yourself how to clear your WordPress cache quickly and easily.

Fortunately, it’s pretty straightforward to clear your WordPress cache. Using a plugin, hosting dashboard tools, or your browser, you can easily flush your cache and generate new copies of your website files that reflect your updates and changes.

In this article, we’ll explore some common reasons you might need to clear your WordPress website’s cache. Then, we’ll show you four easy ways to do it. Let’s get started!

When you might need to clear your WordPress cache

Your WordPress cache is a collection of saved static files. When a user visits your website, they’ll receive cached files rather than running heavy PHP scripts to request new versions of the website. With this setup, caching can help your WordPress site load more quickly for your visitors. In turn, this can improve the user experience and potentially boost your Search Engine Optimization (SEO) rankings.

However, there are times when you might want to clear your WordPress cache. For example, if you’ve recently updated your website’s content or design, you’ll want visitors to see those changes. Manually clearing the cache can generate new copies of your site’s files and show the updated version to users.

You’ll likely want to clear your WordPress cache regularly. This ensures that visitors will always see the newest content, such as comments and recent posts, when accessing your site. Therefore, we recommend purging the cache every 12-24 hours, depending on the frequency of your updates.

Additionally, clearing your cache is often the first step when troubleshooting WordPress errors and performance issues. Sometimes your cache stores outdated files that trigger error messages and prevent you from loading or using your WordPress dashboard or website.

How to clear the cache in WordPress (4 methods)

Clearing the cache in WordPress is a straightforward process. Let’s look at a few different methods you can use to remove cached files and generate new ones.

Method 1: Purge your browser cache

If you’d like to see changes to your website, you can start by clearing your browser’s cache. This method will purge any saved files and force WordPress to generate new copies to display the updated content. However, note that this method won’t change the cached files available to your readers.

This process differs slightly between browsers. In this tutorial, we’ll show you how to purge the cache with Google Chrome. If you use a different browser, you’ll want to follow these instructions for purging the cache.

In Google Chrome, you’ll first need to click on the three dots in the top right corner of the browser window. Then, select More tools > Clear browsing data:

How to clear the cache in Google Chrome.

You’ll then see a popup window that enables you to clear different kinds of data. You’ll want to make sure that the box next to Cached images and files is checked:

Clearing the cache in Google Chrome

You can choose an interval from the Last hour to All time from the dropdown menu. Then, click on Clear data to purge the cache. Once you refresh your WordPress website, the browser will run all the PHP requests and serve the most recent version of your site.

Method 2: Clear the cache from your WordPress caching plugin

Using your WordPress caching plugin is one of the easiest ways to clear the cache. The process will differ depending on the specific tool you have on your website. However, the general steps involve accessing your plugin in the WordPress dashboard and manually purging the cache.

For example, if you use WP Super Cache, navigate to Settings > WP Super Cache and click on the Delete cache button underneath Delete cached pages:

How to delete your WordPress cache with the WP Super Cache plugin.

This plugin also enables you to set up automated cache purges. Navigate to WP Super Cache > Advanced and scroll down to Expiry Time & Garbage Collection. Here, you can choose how long cached files will exist before the plugin clears them out and makes new copies of your website:

Setting up automatic cache purging with the WP Super Cache plugin.

The default timeout for cached files with this plugin is 1800 seconds (30 minutes). However, if your website doesn’t update its content very frequently, you might like to increase this limit to between 12 and 24 hours. Alternatively, you can choose a particular interval from the dropdown menu or choose a cache clear-out time for each day.

Method 3: Clear the cache from your hosting dashboard

Alternatively, you can clear your WordPress cache from your hosting provider’s dashboard. There is usually a simple button that sits at the top of your WordPress dashboard, making this one of the easiest caching methods.

Again, this process will differ depending on your chosen host and the integrated caching solution it uses. For instance, if you use GoDaddy, you’ll want to click on Managed WordPress at the top of your dashboard. Then, select Flush Cache from the dropdown menu:

How to clear your WordPress cache with GoDaddy.
Image source: GoDaddy

It’s that easy! Reload your WordPress website, and you should now see the newest version of it.

Method 4: Use the ManageWP Code Snippets feature

If you use our ManageWP service, you might already know that we use the WP Rocket caching solution. This powerful plugin can boost your website’s performance by reducing your load times and optimizing your site for the Google Core Web Vitals.

WP Rocket automatically creates cached files for your WordPress website. If you want to purge this cache, you can do it from your ManageWP dashboard.

First, you’ll need to select your website from your ManageWP dashboard. Then, click on More Tools > Code Snippets:

find code snippets

Next, you’ll need to enter the following PHP snippet into the box that appears:

<?php 
 
// Load WordPress environment.
require 'wp-load.php';

// Define some constants.
if ( ! defined( 'COOKIEHASH' ) ) {
	$siteurl = get_site_option( 'siteurl' );
	if ( $siteurl ) {
		define( 'COOKIEHASH', md5( $siteurl ) );
	} else {
		define( 'COOKIEHASH', '' );
	}
}
if ( ! defined( 'LOGGED_IN_COOKIE' ) ) {
	define( 'LOGGED_IN_COOKIE', 'wordpress_logged_in_' . COOKIEHASH );
}

// Instatiate the WP_Rewrite class and store it in $wp_rewrite.
$GLOBALS['wp_rewrite'] = new WP_Rewrite();

// Load WP Rocket environment.
require 'wp-content/plugins/wp-rocket/wp-rocket.php';
require 'wp-content/plugins/wp-rocket/inc/functions/i18n.php';
require 'wp-content/plugins/wp-rocket/inc/functions/formatting.php';
require 'wp-content/plugins/wp-rocket/inc/functions/options.php';
require 'wp-content/plugins/wp-rocket/inc/API/preload.php';
require 'wp-content/plugins/wp-rocket/inc/3rd-party/3rd-party.php';

// Clear the cache.
if ( function_exists( 'rocket_clean_domain' ) ) {
	rocket_clean_domain();
	echo 'Cache cleared';
}
 
// Check if sitemap preload is enabled.
if ( function_exists( 'get_rocket_option' ) ) { 
    $sitemap_preload = get_rocket_option( 'sitemap_preload');
}

// Preload the cache.
if( 1 == $sitemap_preload ) { 
	// run sitemap preload.
	if ( function_exists( 'run_rocket_sitemap_preload' ) ) { 
	   run_rocket_sitemap_preload(); 
	   echo ' - Sitemap Preload started';
	}
}

Then, click on Execute code to save the snippet. It will now clear your WordPress cache from the WP Rocket plugin.

Conclusion

Clearing your WordPress cache enables you and your users to see the most updated version of your website. Fortunately, purging your cached files is a straightforward process.

To recap, you can clear your WordPress cache using any of the following tools:

  1. Your browser settings
  2. A WordPress caching plugin
  3. Your hosting provider’s dashboard
  4. The ManageWP control panel

Do you have any questions about clearing the cache in WordPress? Let us know in the comments section below!

Image source: Unsplash

Will Morris

Will Morris is a staff writer at WordCandy.co. When he's not writing about WordPress, he likes to gig his stand-up comedy routine on the local circuit.

5 Comments

  1. Thibault

    There are many other well known caching plugins which should be addressed here.
    While it is not explained how your snippet works > s should we save it each time to launch a cache clearance ? It seems far from being included in the updates process.
    I use W3total cache, which is mostly free and powerful, along with Autoptimize. These are some of the most used plugins.
    Can you please enable an option to clear cache of all installed caching plugins upon update processes, including the +/- 10 most used plugins of the market.
    As you know doing updates is a major moment where issues arrive, but in most cases it’s a simple caching conflict. Therefor, until you release this feature, all your automated process is hardly worthless if we have to go to each website’s admin and clear the cache manually. We lose a lot of the time we should have won.
    Hoping to be heard with this asked effort, but absolutely worth it.

  2. Ritik Kachhot

    WP Rocket and WP-Cache are very helpful to manage WordPress easily. By the way, thank you for this informative article.

    1. Will Morris

      Author

      You’re welcome 🙂

  3. Babita Tiwari

    Thank you for sharing this information. It really helps me a lot to clear my cache in WordPress.

    1. Will Morris

      Author

      You’re welcome, Babita. Glad you found it helpful 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!

Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!

Over 65,000 WordPress professionals are already using ManageWP

Add as many websites as you want for free, no credit card required. Sign up and start saving time!



Have questions? Get in touch!