WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I'm using a Child theme set up correctly. But I just cannot get changes in the Child theme style.css to be reflected in the site. Tried emptying the browser cache a million times and it doesn't work!

I'v created child template files and they overide the parent ones fine.

I have noticed in view sourse it puts a version number on the end of the style sheet like this:- style.css?ver=3.9.1 even though I have created no version!

In another site I created there is no versioning of the style sheet, so why is it being put in automatically when I don't want it set.

How can I force it to use the most up to date version of the Child style.css file and not version it?

Here's my site url:- http://www.peterswebservices.co.uk/

share|improve this question
Browser caching is the most obvious possibility, but server caching can cause the same effect, and so can web "accelerators" that some ISPs and independent sites offer. – s_ha_dum May 20 '14 at 12:57
The version part you are seeing is just the current wordpress version that is automatically added by wordpress. No need to worry about that. – Pieter Goosen May 20 '14 at 13:00

In twentyfourteen, try putting this in your child theme:

function add_require_scripts_files() {
 wp_enqueue_style('twentyfourteen-style', get_stylesheet_directory_uri().'/style.css', array(), '1.0.0', "all");        
add_action( 'wp_enqueue_scripts', 'add_require_scripts_files' );

This will replace the original stylesheet but with your own version. If you are using a different parent theme, look at the original wp_enqueue_style label for style.css and duplicate that label within your child theme. You will have to change 1.0.0 to another number each time you make a change (so it's better for production environments where you don't make changes that often).

To remove the version from scripts and styles all together try this:

// remove WP version tag from scripts and styles, best for dev environments
// by Adam Harley https://wordpress.org/support/topic/enqueueregister-script-remove-version
add_filter( 'script_loader_src', 'remove_src_version' );
add_filter( 'style_loader_src', 'remove_src_version' );
function remove_src_version ( $src ) {
  global $wp_version;
  $version_str = '?ver='.$wp_version;
  $version_str_offset = strlen( $src ) - strlen( $version_str );
  if( substr( $src, $version_str_offset ) == $version_str )
    return substr( $src, 0, $version_str_offset );
share|improve this answer

Without seeing the site we can't help diagnose the issue but a common occurrence is the main theme css is having priority over the child css, you can overrule this by using the !important tag e.g.

#element {
 color:#fff !important;

The important tag marks that css as priority over any other css file with the same line of css

Let us know the url and if this helps

share|improve this answer
I don't think !important is the problem but here's my url:-peterswebservices.co.uk Also when I use the inspector on Google Chrome and drill down to the css file its showing a previous version without the latest changes. – user1199360 May 20 '14 at 13:06

I just had the same problem, and it turned out to be my new host having some kind of caching switched-on by default. I went to my control panel and flushed the cache, and it then correctly served the right style.css file.

The ?ver=3.9.1 turned out to be a red herring (at least for me). After I flushed the cache it still says ?ver=3.9.1, which is not found anywhere in my css file, but it's all working fine.

share|improve this answer
The ?ver=3.9.1is automatically added by wordpress. This is the current version of wordpress and has nothing to do with your theme :-) – Pieter Goosen Jul 11 '14 at 6:52

Adding the below function into the 'functions.php' of a Child theme I used with X helped me very much in the similar situation.

add_action( 'wp_enqueue_scripts', 'enqueue_child_theme_styles', PHP_INT_MAX);
function enqueue_child_theme_styles() {
    wp_enqueue_style( 'parent-style', get_template_directory_uri().'/style.css' );
    wp_enqueue_style( 'child-style', get_stylesheet_uri(), NULL, filemtime( get_stylesheet_directory() . '/style.css' ) );

Just do not forget to remove this before launching your website live.

Also mind caching features of your hosting service provider to make this update effect.

According to author:

... it is the best way to include a childtheme-stylesheet in WordPress combined with filemtime() to force browsers to load new versions of the css-files. I didn’t use filemtime() for the parent-style as I never touch it and therefore filemtime() would only waste resources.

Source: Comment by Daniel as of October 22, 2014 to the article Prevent CSS Caching: https://css-tricks.com/snippets/wordpress/prevent-css-caching/#comment-1586141

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.