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.
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 TweetSo, 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.
Design Tweaks
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.
New Content
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.
Database Changes
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.
Bottom Line
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.
- Delete the cached content plus the minified CSS and JavaScript files.
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.
If you have another plugin thatβs helped you create a widget or menu for your website, but it doesnβt give you individual cache clearing controls, try the Clear Cache for Me plugin. This is also helpful for clearing the cache on anything that affects your themeβs CSS or JavaScript files.
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.
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.