WordPress caches content on your website with the help of caching plugins to speed it up. Based on the plugin you are using, the method to clear the caches would differ. But most of them has a settings page where you could easily purge different kinds of caches including the Static, Dynamic, PHP OP, and Database caches. So, if you have a caching plugin installed on your WordPress website, you are good to go just by clicking on that specific link provided by the plugin to clear your website cache.
But in this article, we are going to talk about a difference scenario where you no longer have a WordPress caching plugin installed. Maybe you disabled it for diagnosing purposes, or you are moving to another caching plugin and the recent caches makes conflicts with the new one. So, we are going to talk about manually clearing the WordPress cache.
If you came here with the intention of clearing cache while a certain WordPress caching plugin is active, this is not how you do it. You shouldn’t manually remove the cache. Instead, use the buttons and features provided by the plugin directly from its respective interface. Check how to clear the cache in WP Rocket.
What is WordPress cache?
WordPress cache is the temporarily stored files that help WordPress to directly serve users with the static versions of web pages without having to run the code over and over again. WordPress cache reduces resource usage considerably, especially if you have repeated visitors to a certain web page.
On the first visit, WordPress, with the help of the WordPress caching plugins, will create a static, cached version of the HTML. It will then be stored on your “wp-content/cache” directory (the structure will vary based on the caching plugin). Whenever a user makes a request to the same URL again, the cached version will be returned instead of the dynamic website.
Why should you clear your WordPress cache?
There are several reasons why you should clear your WordPress cache once in a while. Here are a few reasons –
- To reflect the changes you made to your WordPress website, which will not be visible on the cached version.
- After installing and activating a plugin or theme.
- While switching caching plugins.
- To reduce disk usage by removing the accumulated cache over time.
- For scheduled cache clearance so that new cache files can be stored (this is usually handled by the caching plugins itself).
Manually delete WordPress cache
WordPress stores all your cache files in the directory /public_html/wp-content/cache/. No matter which caching plugin you use to create cached versions of your WordPress posts and pages, all your caches will be stored in different folders in your cache directory inside wp-content folder in your root WordPress installation directory.
So, that means, just deleting everything inside the cache directory will clear all your website caches, thus resolving any cache conflicts with the new caching plugins that you are going to install on your WordPress site. So, the simple way to clear all your WordPress caches manually is by deleting everything inside the /public_html/wp-content/cache/ folder. This will remove not only the static cache but the custom CSS files made by the WP Rocket plugin, the advanced settings PHP files put by the W3 Total Cache plugin, and many more. That’s it, that’s how you clear WordPress cache manually.
That may not be enough
On most of the popular hosting services, there is a separate caching layer provided by the hosting company itself. For example, if you are on Siteground, they have the SG Optimizer. If you enabled any such caching layers, make sure that you manually clear those caches as well.
Just like that, if you are using a CDN, your web pages will be cached on the CDN servers. Make sure to clear your CDN cache as well in order to see the changes on your website.