Have you changed your site’s CSS or published a new post but cannot see the changes? Well, this is most likely a WordPress cache issue. But fret not, turns out you can clear cache in WordPress in minutes and without breaking a sweat.
And in this post, we show you exactly how to clear WordPress cache like a pro.
Before you get lost in this caching business, here’s a bird’s eye view of this post:
- What is Cache?
- How Does Cache Work?
- What Problems Does Cache Cause?
- Clearing Cache in Popular Browsers
- How to Clear WordPress Plugin Cache
- Cleaning CDN Cache
- Purging Cache via WP-CLI
With this outline, let’s drop the anchor and set sail.
Table of Contents
- What is Cache?
- How Does Cache Work?
- What Problems Does Cache Cause?
- Clear Cache in Popular Browsers
- How to Clear WordPress Plugin Cache
- Clear CDN & 3rd-Party Cache
- How to Purge Cache Using WP-CLI
- Over To You…
What is Cache?
If this is your first time, the concept of caching might scare the living daylights out of you. So,ladies and gentlemen, what constitutes cache?
In computing, caching is storing data in temporary memory (as opposed to the main memory), so you can retrieve it in a faster manner the second time you need it.
Makes sense? No? Let us see what the guys over at Wikipedia say.
According to Wikipedia, cache is:
This is the same description we found on other resources, including a Computer Science paper by Boise State University.
You can also think of “cache” as the saved data, even though browsers prefer to call this “Cached Data/Files”, but that is besides the point.
As far as WordPress websites go, caching involves saving a site’s static files on your browser or on the server side. Caching in this case usually involves saving files that change rarely if at all.
How Does Cache Work?
Cache works like magic. No really, jokes aside. In one line, cache makes your WordPress faster. How? You ask.
To comprehend how WordPress cache works, it’s paramount that you understood the basic inner workings of how WordPress builds the pages and posts your see in your browser.
Whenever you load a post or page, your browser gathers different files from your server to build the said page/post. Yes, the page/post you see is, for lack of a better word, “computed” from various files.
Gathering these resources, oftentimes from different servers, takes time. You see, the browser sends HTTP requests to the server, where they are processed before the server responds with the requested resources (files, queries, logic etc).
Now, cache is the in-between mechanism that eliminates this round trip. Instead of loading the same resources from the server all over again, your browser loads the cached copy of that site.
The direct benefit is reduced internet traffic congestion and server load, which results in faster page load speeds for your website.
This is purely because, according to the guys over at Computer Hope, accessing data from cache can be thousands of times faster than accessing the same data from the origin server (read hard disk). See, we said this caching business is easy stuff.
We have also seen websites using CloudFlare Always Online™ cache to create an illusion of being online, while the entire website is offline. In one case, the entire static content was there, but we couldn’t access videos and elements such as forms, search and so on.
However, if caching means good things for your page speeds and user experience, why would you want to clean cache in WordPress? You get the honest answer in the next section.
What Problems Does Cache Cause?
While caching is a good thing, sometimes caching solutions misbehave and can easily give you headaches if you have no idea where the problem lies.
For instance, have you ever made changes to your WordPress site but when you checked, the changes were nowhere to be seen? It’s frustrating, right?
Other times, your cache could hold onto an old copy of a page or an error page such the 502 Bad Gateway error, which could mislead you to think you have an error on your site, while in actual sense, all is good.
Cache inconsistency isn’t much of a problem, but when what’s on the server doesn’t match the cache you have locally, it presents a problem, making it necessary to invalidate, update or purge cache.
When you purge/clear WordPress cache, it means your browser will create cache afresh. But that isn’t really our problem. We are here to clear cache.
There are four types of cache you need concern yourself with where WordPress sites are concerned:
- Browser cache – Browsers keep cache of the websites you frequent, including your own. When facing caching issues, you should clear browser cache first before moving on to other types of cache..
- WordPress plugin cache – WordPress has a plugin for any functionality you can imagine, including caching. Popular WordPress caching plugins include W3 Total Cache, WP Super Cache and WP Rocket among others.
- Server-side cache – This type of cache is created on the cache server by your web host
- 3rd-party cache – Cache of your site stored by third-party services such as Sucuri, CloudFlare and Stackpath (formerly MaxCDN) among others.
Clear Cache in Popular Browsers
Modern day browsers come with integrated caching systems that make browsing the wonderful experience it is. Let us clear cache on the most popular browsers beginning with Chrome.
In your browser, click the menu tab at the top-right corner and navigate to More tools. Next, click on the Clear browsing data item:
Clicking this item launches the settings box:
Tick the Cached images and files checkbox (1), choose how far back you’d like to clear (2) and finally hit the Clear Browsing Data (3) button as shown above.
Clearing cache in Mozilla Firefox is as equally easy. Firstly, click on the hamburger menu icon on the top-right corner of your browser window and click on the History button:
After that, click the Clear Recent History menu item as demonstrated below:
This opens the Clear All History box. Here, tick the Cache checkbox (1), choose the time range to clear (2) and click the Clear Now button (3) as seen in the image below:
Edge is the beta version of the browser formally known as Internet Explorer. If you use Edge, here is how to clear cache in a few clicks.
First of all, click the menu button at the top-right corner, and hit the Settings menu item at the very bottom:
Secondly, locate the Clear browsing data section and click the Choose what to clear button:
On the Clear browsing data panel, choose Cached data and files and click the Clear button:
Just below the Clear button, there is another switch that allows you to setup automatic cache purges that trigger whenever you close the browser. Turning on this feature could mean foregoing the benefits of caching.
Clearing WordPress cache in Opera is as simple as A, B, C. Firstly, hit the O Opera logo on the top-left corner of your browser, and then click the Settings menu item:
This opens the settings page in a new tab. On this page, click the Privacy & Security option:
Next, click the Clear browsing data button under the Privacy section:
This launches a pop up. Here, select Cached images and files (1), choose how far back you’d like to clear (2) and click the Clear browsing data button as we illustrate below:
And finally we have the Safari browser.
Click the Options menu icon at the top-right corner of your browser and then click Preferences:
On the pop up that appears, choose the Privacy tab. Either click Remove All Website Data to clear cache for all websites or the Details button to remove cache for selected websites:
That is how to clear cache on Chrome, Edge, Firefox, Opera and Safari browsers. Do you use a different web browser? If so, please share how you clear cache on your favorite browser in the comment section at the end of this post.
Now, let us clear cache created by WordPress caching plugins.
How to Clear WordPress Plugin Cache
If clearing your browser cache doesn’t get rid of the problem, you should clear your plugin cache i.e. if you’re using a WordPress caching plugin. Most plugins make it easy to create and clear cache.
Clear WordPress Cache – W3 Total Cache
A popular caching solution for a wide range of businesses – big or small, W3 Total Cache helps you to improve your user experience and SEO by boosting your website’s speed.
If you use W3 Total Cache on your WordPress site, here is how to clear cache in a jiffy.
Navigate to Performance on your WordPress admin menu and click Dashboard:
This leads you to the W3 Total Cache dashboard where you can clear WordPress cache simply by clicking the empty all caches button:
And that’s it, W3 Total Cache will purge all caches on your WordPress site. Moving on swiftly.
Clear WordPress Cache – WP Super Cache
WP Super Cache is yet another popular caching solution for many WordPress users across the globe. Clearing cache in WP Super Cache is as easy as pie.
Navigate to Settings in your WordPress admin menu and click WP Super Cache. Next, click the Delete Cache button:
Clear WordPress Cache – WP Fastest Cache
To eliminate the round trip to the server, the WP Fastest Cache plugin creates static HTML files of your WordPress pages. These pages are then served to subsequent visitors, which saves server RAM and memory resulting in a faster website.
Clearing cache in WP Fastest Cache plugin is incredibly easy. Just login to your WordPress admin dashboard and click the WP Fastest Cache menu item:
On the next screen, hit the Delete Cache tab, and then click either the Delete Cache or Delete Cache and Minified CSS/JS button:
But, Are We Done Yet?
Sadly, no. As far as clearing plugin cache goes, most solutions don’t know how to deal with cache created by widgets, menus, the live customizer and plugins such as NextGen Gallery and Contact Form 7 among others.
What to do if you cannot see changes after editing your widgets, menus, NextGen galleries and so on? We introduce you to a nifty plugin known as Clear Cache for Me by Webhead LLC.
This plugin clears cache when you save changes to your widgets, menus, customizer, settings page, Contact Form &, WooThemes settings and NextGen Gallery.
To clear this “leftover” cache, install and activate the Clear Cache for Me plugin. Then click the Clear Cache Now button within your WP admin dashboard:
Note: This plugin will do nothing for you unless you use W3 Total Cache, WP Super Cache or WP Fastest Cache plugin.
Clear CDN & 3rd-Party Cache
Do you use a service such as CloudFlare, Stackpath, Sucuri and KeyCDN among others? If that’s a yes, you need to clear cache if flushing browser/plugin cache didn’t prove fruitful. Let us clear cache in three most popular CDNs as well as Sucuri.
Clearing cache in CloudFlare is straightforward you should be done in seconds. Simply login to your account. Next, select the website for which you’d like to clear cache and hit the Caching button.
After that, click either the Purge Individual Files, Purge By Tag (only available in the Enterprise plan) or Purge Everything button as shown below:
Keycdn is a reputable content delivery network powering a huge number of websites across the web. To improve the performance of your site, they implement a couple of technologies including caching.
Now, to clear cache in Keycdn, just login to your account and click the Zones tab:
This leads you to your zones (caching profiles). Here, choose your zone (we have only one zone in our example). After this, click the Manage drop down menu and choose either Purge, Purge URL or Purge by Tag:
That should take care of your cache if you use Keycdn.
Stackpath (formerly MaxCDN)
The internet is never short of content delivery networks. Top among industry leaders is Stackpath. Here’s is how to clean cache in Stackpath.
Login to your Stackpath dashboard and click Sites from the menu:
On the next screen, locate your site and click the Manage button:
Next, hit the Manage Cache item as shown below:
The next screen helps you to purge cache for individual files, all files or top 50 popular files:
Sucuri offers backup and security solutions for millions of WordPress users just like you. It’s a subscription-based premium service that’s offered as part of Jetpack.
Are you a Sucuri customer? If so, cleaning your cache is as simple as navigating to Performance -> Clear Cache – Global in your Firewall Settings. Next, click the Clear Cache button:
How to Purge Cache Using WP-CLI
As a fan of WP-CLI (short for WordPress Command Line Interface), you probably never use the browser to manage your WordPress site as much as before.
If you use WP-CLI, purging your cache is as simple as running the
& wp cache flushcommand as shown in the example below:
# Flush cache. $ wp cache flush Success: The cache was flushed.
Note that this command comes with a number of arguments as seen in the WordPress Developer’s Handbook. These arguments help you to purge specific pages and do a number of cache-related things.
Over To You…
Caching your WordPress site means all manner of great things for speeds and user experience. However, at times, cache becomes a problem you can resolve easily by clearing any of the caches we mentioned above.
How do you clear cache in your WordPress site? Let us know in the comment section below. Cheers!
This post was last modified on April 5, 2018, 6:47 am