One of the best things you could do to enhance the performance of a WordPress website besides maintaining proper security is to enable caching. But what happens when you want to clear the cache? And is this something you need to learn to do if software automates it for you?
The following guide will, first, tackle all the reasons you would want or need to clear cache on WordPress sites. Then, we’ll look into the variety of ways to purge or delete cache both inside and outside of your WordPress installation.
Reminder: What Is Website Caching and Why Do You Need It?
To recap, this is how a web page loads:
- Someone encounters a link to your website--in search, on social media, on someone else’s website, or in your email signature.
- They click on the link to be redirected to your WordPress site.
- The ensuing HTTPS request asks your web server to put together and deliver all the files to load the website in their browser.
- For every image, file, and script that needs to be compiled, the HTTPS request takes longer to complete.
- If the person is willing to wait, they will eventually be served a completely loaded website.
And, this is what happens when WordPress website caching is enabled:
- Someone encounters a link to your website.
- They click on the link to be redirected to your WordPress site.
- The ensuing HTTPS request is sent to your web server.
- The server detects that there have been no changes to the content since the last time someone visited the website.
- The server grabs a static copy of the website, and quickly sends it to the person’s browser window.
- This will happen with all subsequent visits until the content on the page has changed or the cache has expired and is automatically purged.
In essence, caching provides for a more efficient way to deliver content to website visitors.
This ability to speed up loading times is essential if you hope to capture more leads and generate more business with your website. No one wants to wait more than a couple seconds for a web page to load and WordPress caching is one of the mechanisms that enable you to meet those visitors’ expectations.
That said, there are times when you will need to clear cache on WordPress websites.
Free Website Speed eBook
The 12-Step Checklist to
Achieve Loading Times Under 1 Second
Reasons You Need to Clear Cache on WordPress Websites
The reason we use website caching is because it provides an optimal experience for visitors. By sending a saved static copy of the site, your website can load much more quickly with each new visitor.
That said, what’s the point in making a website faster if you don’t have new content to display to visitors?
People aren’t going to visit your website unless you have something compelling or of value to share with them. And people certainly won’t return to your website if you don’t continually populate it with new content.👏 While caching is supposed to clear, the second something changes on your WordPress site, that’s not always the case. Sometimes, you have to take matters into your own hands. Boom! #WordPress Click To Tweet
So, let’s talk about some of the ways in which caching might accidentally stand in the way of delivering new content to visitors’ screens and why you need to learn to clear it manually as a result.
Think of a website as you would any other piece of marketing collateral. Contact information may change. Product details may need to be added. Branding may need to be revamped. There is always something to tweak (or overhaul) on a WordPress website because it needs to stay in sync with the business--and businesses that stand still will stagnate and eventually fade away.
But if you’ve just updated the design or content of a WordPress site and can’t see the changes when you view it on the frontend, the caching mechanism likely hasn’t detected the change.
Websites need a stream of relevant and valuable content published to them. Content like blog posts, white papers, and case studies are a great way to attract new visitors and appeal to old ones to return. When this happens, search engines take note. Google, in particular, loves to see websites that are regularly updated and growing in size with high-quality content.
That said, if your web server retains the cached version of that page or does not display the new content to visitors, Google’s bots won’t be able to crawl it either. This issue tends to happen when you add content to widgetized areas of the website.
Plugin and Theme Updates
According to D5 Creation, a big reason to manually clear the WordPress cache relates to WordPress updates. Specifically, whenever plugin and theme updates occur, you should purge the cache afterward to ensure that any changes made to the code, files, or the outward appearance of the website go into effect on the next HTTPS request.
According to GoDaddy’s managed WordPress FAQ, its caching mechanism may cause problems if not cleared under certain circumstances.
If your website resides on managed WordPress hosting, this is important to take note of. Any changes to files in your database or even a migration of a website will likely require a clearing of the cache so visitors aren’t displayed error pages or an antiquated version of your website.
Externally Hosted Images
ShortPixel has one further idea on why you might need to manually clear the cache on WordPress websites.
If you use a WordPress plugin to optimize your images, you might find that the server continues to deliver older, uncompressed versions of them afterward to ensure it picks up the compressed images from the plugin, clear your cache after optimization.
As these changes to your website take place, your caching mechanisms need to detect when they occur. When they do, the WordPress cache will clear and the web server will tackle the next HTTPS from-scratch so that updated content is delivered to the browser.
But this is software we’re talking about. It will usually do everything we need it to, but there are times when it’s just not smart enough to realize an image with the same file name but different color product has been swapped out.
Which is why we need a way to clear cache on WordPress websites ourselves.
How to Clear Cache on WordPress Websites
The WordPress Codex has a page called “I Make Changes and Nothing Happens”. If you’ve worked with WordPress clients or hired employees who are new to WordPress, you’ve likely heard this before. Heck, you may have even said this once or twice when you were first getting the hang of WordPress. Sometimes this has to do with people not remembering to hit the “Update” or “Publish” button after making changes. It’s a common rookie mistake.
But then there’s the matter of the website cache.
As explained above, there may be times when you have to manually clear cache on WordPress websites in order to see updates on the frontend.
Because you’re using caching inside WordPress as well as outside the CMS, there are a number of ways to manually purge the cache from WordPress. If you can’t see changes reflected on your website and you’ve confirmed it’s not user error inside WordPress, here is what you need to do:
1. How to Clear Cache on Your Browser
The clearing of browser cache is only something you can do for your own device. John Hughes over at Elegant Themes offers a concise description of this process as well. If you suspect the cache issue is occurring on a larger scale, skip down to one of the options below. If not, start here.
This is an example of how to clear cache in Chrome.
You can clear cache for your WordPress site from the History or Settings tabs. Once selected, navigate to the “Clear Browsing Data” section. Your browser will display the following pop-up:
In this screen, you can clear browsing data for cached images and files. This will delete the cache from all websites in your browsing history.
If you want to clear cache just for your website, return to Settings and go to Content Settings:
Next, click on Cookies:
Expand on “See all cookies and site data”:
Do a search for your website:
You can then go through and clear all data.
If you work in another desktop or mobile browser, refer to VisualModo’s quick reference guide on how to clear cache in all major browsers. Or, follow this handy guide put together by Indiana University.
2. How to Clear Cache Using Your WordPress Caching Plugin
If you’ve utilized WP Buffs’ 12-step checklist to a speedier website, then you already have a caching plugin installed on your WordPress site. You could also check out the best caching solutions for WordPress compiled by Search Engine Watch. Each of these come equipped with a handy cache clearing option.
Chances are good that your website uses one of the top three caching plugins.
Here, we will cover where you can find the WordPress cache clear option for each.
Clear cache with W3 Total Cache:
Go to the Performance menu and locate the Settings for the plugin.
Scroll down the page and take note of the individual caching settings. When enabled, you’ll be given two choices to clear cache on your WordPress site:
“Empty cache” is for when the settings remain the same, but you want to delete the cached data for that particular option. “Save Settings & Purge Caches” enables you to save a new caching configuration and purge the current cache all at once.
Or you can instantly purge all cached content and data from your website using the Performance menu in the admin toolbar:
Clear cache with WP Super Cache:
This is a significantly less complex plugin, which means you will have less control over which cached data can be cleared. All the same, it’s very easy to execute and there are three spots in which you can do this:
- Easy tab
- Contents tab
- Admin toolbar
Clear cache with WP Fastest Cache:
Here is another plugin that is easy to configure and use when you want to clear cache on a WordPress site.
To clear the cache, go to the Delete Cache tab.
You have two options:
- Delete the cached content.
You can also do this from wherever you are in WordPress. Just expand the “Clear Cache” menu in the admin toolbar and you’ll see the options there:
3. How to Clear Cache When You Have Managed WordPress Hosting
Caching can and should also take place server side. This will slightly differ from WordPress website caching as server-side caching includes things like PHP caching, object caching, MySQL caching, and so on. Website caching only creates a copy of what’s inside WordPress--your content and files.
So, if you find that clearing cache in WordPress hasn’t helped, or you simply want to be thorough, you can clear cache from your server, too.
If your WordPress website uses shared or cloud hosting, then you might not have any control over this. SiteGround, however, is one hosting company that enables developers to activate and flush caching from the control panel:
If you’re using managed WordPress hosting, that’s a different story. Managed WordPress hosts like Kinsta often empower users to purge their own cache. As you can see in this example, Kinsta has its own cache plugin so that developers can clear single pages as needed:
If in doubt as to whether or not you can purge server-side caching, reach out to your web hosting company. Even if they don’t give you direct access to do it, you can explain the problem you’re having (i.e. you’re unable to see updated content) and they can handle it for you.
4. How to Clear Cache When You Have a CDN
A content delivery network (CDN) provides WordPress websites with an additional level of caching. Basically, a CDN sends a cached copy of your website from one of its far-flung data centers to website visitors that are nearby. So, not only do you benefit from delivering cached content quickly to visitors, you shorten the physical gap between the server and them. (Which makes your loading speeds incredibly fast!)
To clear cache on your CDN, you will have to log into your third-party CDN platform to do so. We would suggest you start with this article from 000webhost. Their CDN caching section is well-rounded and includes notes on how to do this for CloudFlare, KeyCDN, Stackpath, and Sucuri.
If you use one not included on this list, check their FAQs for information on how to clear cache for your WordPress site’s CDN.
5. How to Clear Cache on Your Reverse Proxy
An HTTP reverse proxy like Varnish or Nginx is another type of caching you may want to purge.
If enabled, you should install the Proxy Cache Purge plugin. There are a few reasons for this:
First, if you want to prevent users on the front end of the site from seeing updates you’re making to the website, you can do so in Settings by putting it into Development mode:
This ensures they only see the cached content (pre-update) while you work on the site.
You can also use this plugin if you want to know if caching is working properly:
After you run the test, it will tell you if something like a plugin or theme is creating a conflict and preventing your website from clearing cache properly.
To completely purge a reverse proxy cache with this plugin, use the menu in the admin toolbar:
6. How to Clear Cache on Your WordPress Firewall
Technically, a WordPress firewall is a reverse proxy as it reviews and filters traffic before it reaches your website. The key difference is that one is meant for performance enhancements (the proxy) and one is meant for security (the firewall).
Depending on which tool you’ve used to implement the WordPress firewall, you may not have control over clearing the cache.
Sucuri Security is one such example of a WordPress firewall plugin that does have cache clearing enabled though:
While you do want to set the security plugin to automatically clear the cache when content is updated, you can also use this to instantly clear cache if you’re having issues seeing updates on your site.
7. How to Clear Cache for WordPress Content Plugins
There are a bunch of plugins that you may use to create and optimize content on your website. Because they hook directly into your pages, pop-ups, widgets, galleries, and feeds, there is a chance that your inability to see updated content stems from a problem with caching on the plugin’s end.
In many cases, the clearing of your WordPress caching plugin should resolve the issue. In other cases, you may have to look to the content plugin itself for assistance. The WordPress Popular Posts plugin is one that enables developers to do this.
Navigate to the settings of the plugin in your WordPress dashboard and locate the Tools. Then, scroll down to the bottom of the page:
As you can see, you clear the cache for this plugin’s data.
Once installed, a new widget will appear in your WordPress Dashboard:
By clicking this button, you can force your website to clear the cache for all scripts and files. This is an ideal solution if you have a plugin whose changes never seem to make it to the website upon updating it.
8. How to Clear Cache Using the WordPress Command Line
Finally, let’s talk about how to clear cache using the WordPress command line. As WordPress explains here, this is so you may flush the object cache in your database.
To do this, execute the following in your WordPress command line:
# Flush cache.
$ wp cache flush
Success: The cache was flushed.
This will ensure that snippets of content or design elements that have been cached as objects or fragments will refresh to their latest and greatest state.
Free Website Speed eBook
The 12-Step Checklist to
Achieve Loading Times Under 1 Second
Caching is Vital for Your Site’s Success
Caching is an important part of what makes your WordPress website perform so well. But there are times when you have to clear that cached data so that updated content can be shown to visitors.
The above guide details the various ways in which you might need to clear cache on WordPress websites in order to display those updates. But if you find that you don’t have time to handle caching management or other pieces of your speed optimization strategy, get in touch with WP Buffs and let them take care of it for you.
Want to give your feedback or join the conversation? Add your comments 🐦 on Twitter.