How to Clear Cache in WordPress

Middle aged woman standing using laptop on table

If you work on WordPress websites, you’re probably tired of telling clients or team members to refresh their browsers to see the changes you just made. And the reality is, a browser refresh might not even work, and you may need to clear the cache in WordPress for changes to appear.

This post will explain how caching works, when you might need to purge your cache, and how to clear cache for a WordPress website.

Caching Basics

Before we talk about how to clear cache, we need to review the different types of cache for WordPress sites.

Caching is a technique to improve your website’s performance. When your server receives a request for a page from a browser, it has to return all the HTML, CSS, scripts, and images needed to load the page. A cache is a temporary copy of some of your website’s static elements that can help render a page without having to look it up.

The three main types of cache for WordPress sites are:

  1. Browser Cache: The browser cache stores files locally on a website visitor’s computer so pages will load faster. When you do a hard refresh (shift plus refresh), you’re telling the browser to remove the local cache when loading a page.
  2. Server Cache: The server cache limits the number of requests your server has to handle at once. For example, it can serve up a cached copy instead of looking up a stylesheet.
  3. CDN Caching: A CDN (content delivery network) caches parts of your website on servers at data centers across the globe. The server physically closest to a website visitor will serve up any cached content, so your server only has to handle the uncached requests.

When we talk about clearing the cache for WordPress, we’re looking at how to clear your server and CDN caching.

When to Clear Cache on Your Site

In most cases, your server or CDN will automatically update cached files on a set timeframe. For example, you might have a setting to check for new files after 48 hours. Sometimes you can’t wait until the next time the website cache will be refreshed and you may need to speed that process up.

The three most common reasons you’ll need to delete WordPress cache are:

  1. Adding New Content or Updating Existing Content: When you revise your website content, you might have to delete the cache to see the updates on your site. Clearing the cache is the go-to first-level troubleshooting step because it often solves problems with how content and layout are displayed.
  2. Modifying Design: You’ll want to purge your cache when you change your website or page design. This is especially true if you modify a CSS file. CSS files are often cached by default, so purging your cache will allow the CSS changes to display correctly.
  3. Updating WordPress Plugins: If you update a plugin or change the settings in a plugin, it’s a good idea to delete your cache. Plugins generate CSS and scripts, so you might need to empty the cache to see the plugin changes reflected on your live website.

Options for Deleting WordPress Cache

The method you use to clear your cache will depend on how your site caching is set up. If you use a caching or optimization plugin, follow the instructions from your plugin developer.

If, instead, you opted for the simplicity of caching through a managed WordPress hosting service, you’ll follow the instructions from your hosting provider.

Let’s look at how easy Pressable makes it to clear your cache and manage your cache settings.

Pressable offers three types of caching:

  1. Page and Query Caching: Page caching and database query caching utilize WordPress’ Object Cache. By default, page and database query caching is turned on, but you can manually exclude certain pages if needed.
  2. Static Asset Caching (CDN): All Pressable plans include our global CDN for faster websites. Pressable’s CDN automatically caches standard file types such as jpg, jpeg, gif, png, webp, css, bmp, js, woff2, and ico. The default cache time for CDN files is seven days, so you’ll need to purge the CDN if you update any of these static assets faster than that timeframe.
  3. OPCache (PHP Code): OPCache stores a precompiled script bytecode in the memory. Utilizing this caching reduces server load in future calls for a PHP file by having it ready to go.

You can clear and manage caching from your Pressable dashboard or our Pressable plugin. Let’s look at both options.

Using the Pressable Dashboard to purge your cache:

  • From your dashboard, select the site you want to clear the cache for and click on Performance.
  • From there, you can purge the CDN or flush the Object Cache.
Clearing cache on site performance Pressable dashboard

Using the Pressable Cache Management Plugin to manage cache:

  1. Pressable’s cache management plugin allows users to manage Batcache and Pressable CDN settings right within the WordPress admin panel. Your first step in using this option is to download the files on Github.
  2. Next, upload the plugin files to the /wp-content/plugins/pressable-cache-management directory, or install the plugin through the WordPress plugins screen directly.
  3. Activate the plugin through the Plugins screen in WordPress.
  4. Use the Settings screen to configure the plugin. We’ve provided detailed instructions for installation and setup in our knowledge base.

Pressable’s caching is just one example of why hosting with us is best for WordPress. We make things simple and ensure your site loads fast.

Schedule a demo to see how Pressable can make your cache management fast and easy!

Zach Wiesman

Zach brings a wealth of knowledge to Pressable with more than 12 years of experience in the WordPress world. His journey in WordPress began with creating and maintaining client websites, fostering a deep understanding of the intricacies and challenges of WordPress. Later, his knack for problem-solving and commitment to service led him to pursue a role at Automattic, where he excelled in providing customer support for WooCommerce. His expertise extends beyond technical proficiency to encompass a deep understanding of the WordPress community and its needs. Outside of work, Zach enjoys spending time with his family, playing and watching sports, and working on projects around the house.

Related blog articles