Skip to content

WordPress Stylesheet Versions: Diagnose CSS That Stayed Old

Check the stylesheet URL and actual CSS response in WordPress. Compare the installed-version default with an explicit release version.

Two style proofs with cream and lavender swatches, the second marked with an orange corner tab
Jack Lee
2 Min Read
Share
On This Page

You edit a stylesheet, but the WordPress page still looks the same. Start with the exact file the browser requested. The CSS on disk, the link in the HTML and the winning rule in the browser can differ.

Identify the stylesheet and its version

For a front-end stylesheet loaded through wp_enqueue_style(), the version argument can add ver to the URL. Passing false uses the installed WordPress version. Passing null omits the version. Use an asset revision if the stylesheet is released independently.

Check the generated link and file in local WordPress

We ran WordPress 6.9 in Playground. A test hook enqueued a dedicated stylesheet under Twenty Twenty-Five, then we read the page’s link element and requested each emitted URL.

Test stateURL suffixDirect CSS response
Original rule, default versionedition-proof.css?ver=6.9200, heading colour #262626.
Edited rule, same versionedition-proof.css?ver=6.9200, colour changed to #563b8c.
Edited rule, explicit versionedition-proof.css?ver=release-2200, same new colour.

The response body changed after the edit, but the stylesheet URL stayed the same until we supplied a release version. The test observed the handler’s response. Browser and CDN cache behaviour were outside its scope.

Find the layer that needs a fix

  1. Check the element in DevTools and open the stylesheet that supplies its rule. The active file might be from a child theme or an optimization plugin’s combined output.
  2. Compare the stylesheet link in the public page with the expected release URL. In Network, open the CSS response and search for a selector or value introduced in that release. If the file was updated but the href stayed the same, set a stable version tied to the asset release.
  3. Retest the public page after deployment and confirm it emits the new href and serves the expected rule. If the file is fresh and the new rule still has no effect, inspect the cascade in Styles. Use the WordPress release checklist to verify after deployment.

Frequently asked questions

Why can WordPress keep the same CSS version after an edit?

The default version comes from WordPress, so a CSS edit alone may leave the stylesheet URL unchanged.

Why might the new version still serve old CSS?

The generated bundle can be stale, or a caching layer can ignore the query parameter. Check the bytes served for the exact URL and the cache settings. See the HTTP cache response guide.

Should I use the current time as the version?

Use a build revision or file hash that changes when the asset changes. A value that changes every request prevents useful cache reuse.

Share This Article