WordPress Theme CSS Not Updating ( 4 Easy Fixes)

wordpress theme CSS not updating

[ctoc title=”Table of contents” type=”ol” items=”WordPress theme CSS not updating,How do I fix the issue?,Conclusion”]

Is your WordPress theme CSS not updating?

This can be very frustrating when you are customizing your WordPress theme and your homepage does not show up as intended, but it can be fixed very easily.

Read on to find out more.

WordPress theme CSS not updating

The reason for your WordPress CSS not updating is due to the caching issue in your browser, website, or CDN. You can easily fix the issue by clearing the cache or increasing the version number of style.css.

How do I fix the issue?

Let’s learn in detail how to use the above methods to fix the issue.

Clear Browser cache

One of the common reasons for this issue is that CSS changes are not reflected in Chrome.

Your browser may have the old website files in its cache.

You need to clear the browser cache and fetch the new version of the files again.

First, try refreshing the page by clicking on the Ctrl + Shift +R button on your keyboard.

If this does not resolves the problem, clear the browser cache.

If you are using the Chrome browser, click on the 3 dots on the top right, go to More Tools and then click on Clear Browsing Data.

Select Browsing history, Cookies, and other site data, and Cached images and files.

Then press the Clear Data button.

Clear CDN cache

Another reason for the issue may be because of CSS file not updating on server.

If you are using a CDN like Cloudflare, the old files may still be stored there too.

So you need to purge the CDN cache too.

So, if you are using Cloudflare, go to Caching > Configuration and under Purge Cache, click Purge Everything.

If you are using a different CDN, read its documentation on how to purge the cache.

Clear plugin cache

If you have the minify/combine options enabled in your cache plugin like WP-Rocket, clear the cache of the plugin

You can also try to disable the cache plugin altogether to check whether it is causing the issue.

Increase the stylesheet version number

If none of the above options works for you, then you have to work with the codes manually.

If the WordPress child theme CSS not updating, open the style.css file and change the version number at the top of the file to any other number.

The style.css is located at \wp-content \ themes \ theme_name \ style.css

You can also find it under Appearance > Theme file editor.

After changing the version number in the file, open the functions.php file.

Change the version number to the same number in the line (the code in your theme may be a little different) – 

wp_enqueue_style('style', get_template_directory_uri() . "/assets/css/style.css", array(), '1.0', 'all');

Conclusion

To fix the issue of your website not being updated after modifying the CSS code, perform any or all the actions below – 

  • Clear the browser cache.
  • Clear the CDN cache.
  • Clear the plugin cache.
  • Add a new version number for the style.css file.
Back To Top