Simple Steps to Clear WordPress Cache on Websites

If you are a regular reader of WordPress communities on social media, you would have come across the question of website cache a lot of times. Website cache is an integral part of site maintenance, and if it is not cleared promptly, it can cause performance issues.

Most of the beginner WordPress site owners don't know how to improve their website performance. They think that cache is the only way to improve site performance, and that's why they ask about how to clear it. In a way, they are right.

In this article, we will discuss what WordPress cache is actually about and how it can help your WordPress website.

What is Site Cache and How Does It Helps Your Website?



Whenever someone visits your website, the server will create an image of that page. When they visit the next time, the page loads faster. This would mean that your server will get fewer requests from the same person, and the content from the server cache will be served to the user. It makes site performance faster, decreases loading time, and enhances the user experience. That's why the cache is considered one of the best ways to improve site performance.

Now, with WordPress, you have app-level caches available like Breeze, W3 Cache, and many others. These plugins add a cache layer to the website that provides faster access to frequently searched content.

Now, you’re probably thinking that if website cache is doing such a great job, why is it important to clear it?

Here are the reasons:

  •   Cached content doesn’t add new posts - that you have published to your website.
  •   Cached pages can increase the storage size, making the website to load slowly.
  •   When you have extra small storage space, you would want to clear the website cache.

You can also set the time range for the content to be stored in the cache file. For example, if you set the expiry time of images to one year, all cached copies will be automatically cleared after one year. Keep in mind that setting a more prolonged interval might prevent you from seeing the updated version of the site.

What If You don’t want to Clear WordPress Cache Manually?



However, if you don't want to clear your cache now and then, you can do one of the following:

  •   Set expiry time for your website cache
  •   Manually delete WordPress website cache from Cpanel or FTP
  •  Install a WordPress website cache plugin that will do it all for you

WordPress Cache Clearing Methods & Plugins



Multiple WordPress website cache plugins can clear the site cache within minutes. But before we get to them, let's learn the manual process of clearing WordPress site cache.

Clear WordPress Website Cache Manually

You will have to access your website from the backend. Use the FTP server or CPanel file explorer to locate the 'wp-content/cache' folder. All the website cache is saved inside the 'cache' folder. So, simply empty this folder, and this will delete the site cache.

Adding Cache Expiry Headers in WordPress

Expiry headers is another way to limit the WordPress site cache to a year only. You will have to add the expiry headers to the .htaccess file.

Add the following code to your .htaccess file to get it done.

    < IfModule mod_expires.c >
    # Turn on the module.
    ExpiresActive on
    # Set the default expiry times.
    ExpiresDefault "access plus 2 days"
    ExpiresByType image/jpg "access plus 1 month"
    ExpiresByType image/gif "access plus 1 month"
    ExpiresByType image/jpeg "access plus 1 month"
    ExpiresByType image/png "access plus 1 month"
    ExpiresByType text/css "access plus 1 month"
    ExpiresByType text/javascript "access plus 1 month"
    ExpiresByType application/javascript "access plus 1 month"
    ExpiresByType application/x-shockwave-flash "access plus 1 month"
    ExpiresByType text/css "now plus 1 month"
    ExpiresByType image/ico "access plus 1 month"
    ExpiresByType image/x-icon "access plus 1 month"
    ExpiresByType text/html "access plus 600 seconds"
    < /IfModule >


If your .HTAccess file already has some script in it, add the above script right after that script ends. If you don’t understand something, feel free to comment.

Clear WordPress Cache Using Command Line



Okay so that we have added expire headers to our WordPress website, before we see plugin options to clear cache, let’s learn how command line can do it for us.

WordPress explains that you can flush the object cache in your database. Here is the code to do so. You will need to have command-line access to your server to perform this task.
Execute the following WordPress CLI command to clear the cache.


# Flush cache.
$ wp cache flush
Success: The cache was flushed.

The above action will automatically flush the Wp_Content cache giving you a new and faster look.

Plugins That Can Clear WordPress Cache



There are a lot of plugins available to clear and optimize WordPress cache. The top ones are W3 total cache, WP rocket, Breeze, LiteSpeed, and many more. The purpose of these plugins is that they can help you control what to cache, when to expire it, and when to clean it, all through a GUI panel.

Now that you are aware of these plugins let's learn how to use them to improve your site performance.

Clearing the WordPress Cache with W3 Total Cache

Clearing the WordPress Cache with w3 Total cache plugin is relatively easy. The plugin comes with everything preloaded, you just have to install it, press a few buttons, and that's it. Let's see how:


Clear WordPress Cache


  •   Install WordPress Cache plugin on your website.
  •   Once the plugin is installed, click on it and enter the performance tab.
  •   You will have two options: Clear all cache or clear cache of Memcached, opcode, and disk.
  •   If you are a total beginner, it is better to clear all cache.
  •   You can also check all three separately to see how they affect the performance of your website.
  •   Disk Cache is the primary 'Wp_Content' cache. The rest of the two are either server-level or CMS-level cache that will automatically get purged when you click on 'Clear all.'

Clearing WordPress Cache with WP Rocket

Next, you will have to clear WordPress cache using WP Rocket. So, how does it actually work? Let’s find out.


Clear WordPress Cache

  •   Install the plugin on your WordPress CMS
  •   Now, go to Settings > WP Rocket > Clear all Cache
  •   Similarly, you can clear the cache of each post/page separately by opening it and then in the top menu, select WP Rocket > Clear this cache

Do it with all blog posts that are visited the most by your site users.

Since WP Rocket is a paid plugin, you can use it for many other activities such as browser caching, GZip compression, database optimization, Minification, CDN, and much more. You will have to buy it for $49 (the price mentioned as of the writing of this blog post).

Clearing WordPress Cache with Breeze

Next, we have the WordPress cache plugin Breeze. It is free and simple to use. It works with almost all versions of WordPress and has received positive feedback from users.


Clear WordPress Cache

  •   First, install and activate the Breeze WordPress Cache Plugin.
  •   Open the plugin > Settings > Purge all Cache. This is the basic setting in Breeze.
  •   However, if you are an experienced WordPress user, you may want to play with the advanced features of the plugin like CDN, Database optimization, and JS and CSS minification many more.
  •   The purge cache feature will clear the whole of the cache of the last 24 hours that is 1440 minutes.
  •   If you are not an experienced user, it is recommended that you don’t modify the Minification setting.
  •   If your website receives a lot of traffic, better create a clone version and test these features in the staging environment.
  •   Finally, enable GZip compression on the server from the plugin menu if you haven’t already done so using the .htaccess file.


Clearing the WordPress Cache with LiteSpeed

The LiteSpeed WordPress cache is from the Litespeed server technologies. They have provided the cache plugin to use with the LiteSpeed web server to give an extra boost to your website. However, the cache can also work on the website that doesn't have a Litespeed web server installed.


Clear WordPress Cache

Optimizing Cache without Litespeed Web Server

  •   Install the LiteSpeed Cache from the WordPress directory.
  •   Now open the LiteSpeed Cache plugin > Settings.
  •   In Advanced View, enable the available optimization features.

Optimizing Cache with Litespeed Web Server

First of all, install LiteSpeed Web Server Enterprise with LSCache Module, LiteSpeed Web ADC, or OpenLiteSpeed with cache module [Free].

  •   If you are using the Litespeed server, there are some cache changes you can make to your WordPress website. Now, install the LiteSpeed Cache for WordPress plugin.
  •   In LiteSpeed Cache> Settings, Enable LiteSpeed Cache by setting it to Enable.
  •   Now, enable any desired features from the various tabs available In the Advanced View tab.

Clear WordPress Cache in Sucuri

Although Sucuri is not a performance optimization plugin, many use it for protection and performance optimization. It also has a WordPress cache clearing functionality. Here is how you can clear the cache with this plugin:


Clear WordPress Cache


  •   Install Sucuri on your WordPress website.
  •   Once the plugin is installed, open Sucuri > WAF menu.
  •   Now clear the cache of your WordPress website.

Clear Browser Cache



By now, your website will start to show performance changes, but if you still haven’t seen any performance change, then ‘clear browser cache.’
Select a browser than you conveniently use to browse websites. If it has too much data, go to Settings > History > Clear Browsing Data > Clear Cache


Clear WordPress Cache


This is the prompt from Google Chrome. Your browser layout will be different but the process will be more or less the same.

Testing Performance with Pingdom

Now that we are done with WordPress cache optimization, it is time to perform some testing to make sure that our website is performing at peak level.
Open the Pingdom site testing tool.


Pingdom


Enter your website in the URL section and select a test server. Now, START TEST.


Clear WordPress Cache


Now, do it with your site and see if the performance has improved.

Testing Performance with GTMetrix

GTMetrix is another excellent performance testing tool for websites. We will use it to test if our website performance has increased after clearing the WordPress cache.



The tool is much more comprehensive and provides a detailed report about what you should fix to improve your site performance. Moreover, just like Pingdom, you can select a performance testing server of your choice.

GTMetrix

Here are the results. It also shows the same performance improvement. So, yes!

Our site performance has truly increased by clearing the WordPress cache.

So, Do You Really Need to Clear Cache of WordPress Website?



Yes, if you want your website to perform at peak levels at all times, you need to maintain it regularly. Since cache clearing is part of the maintenance work of any WordPress website, it is important.

However, you don't have to clear the cache of the WordPress website at all times. If your website receives a lot of traffic - especially of a few pages, then it is pertinent that you clear the cache of those pages regularly.

Otherwise, the cache problems can cause performance issues, and people will stop coming to those pages.

When your site faces performance issues, it will indirectly impact your website SERPs. And, when your website SERPs are affected, your traffic will decrease, so will your Domain Authority, and rankings.

So, in a sense, clearing the WordPress cache is part of the bigger picture that helps you stay at the top of your game.

The bottom line is…



As we have learned, clearing website cache is an essential task for any web administrator who is looking for the long-term success of their business. It not only improves site performance but also helps you stay secure and avoid any technical hurdles on your website. Outdated cache files can become a bottleneck of problems for your visitors who would like to see the latest version of your website. If your website is frequently updated, it is fair that you use an appropriate server-level and app-level cache technology to enhance site performance.

We hope that we have provided a thorough guide on how to clear WordPress cache with or without plugins. If you have any questions regarding clearing WordPress cache, please shoot them in the comments below. Also, if you are not able to clear the cache on your WordPress website, get in touch with The WP Help.

We’ll fix all your website cache issues plus anything you need us to work on right away! 🙂

Insane Speeds with Awesome Support
The WP Help enables you to grow your business, while we handle your website.