Support » Plugins » WP adds long version query strings to CSS and JS files

  • APTM

    (@antonputtemans)


    I noticed WP adding long query strings to my CSS and JS files. Not just the version parameter from wp_enqueue_style from a Theme or something, no something fishy going on. I even switched to the 2016 theme to be sure and even there:

    localhost/wp-content/themes/twentysixteen/genericons/genericons.css?ver=26a451f6ce396fe8c8b0ae0cf1b05446

    localhost/wp-content/themes/twentysixteen/style.css?ver=26a451f6ce396fe8c8b0ae0cf1b05446

    What is this and where does it come from? I am not using WP’s debug mode, nor using any caching plugins or something..

Viewing 3 replies - 1 through 3 (of 3 total)
  • Moderator Andrew Nevins

    (@anevins)

    WCLDN 2018 Contributor | Volunteer support

    Try deactivating your plugins to explore whether any could be responsible. This doesn’t occur on the theme’s demo: http://wp-themes.com/

    APTM

    (@antonputtemans)

    Thanks for the help.
    I could have thought about deactivating plugins…
    Anyway, it was WordFence:

    This query string is from the option “Hide WordPress version” — it replaces the original “ver=” string that already appears on the static content. If you uncheck that box, you will see the original version numbers instead, without any changes from Wordfence.

    It shouldn’t affect any pageload scores, since it is only replacing a version string that already exists, but may affect browser caching if you need query strings to change to cause an asset to expire. In an upcoming version of Wordfence, this part of the query string will only be replaced if the “ver=” string matches the WordPress version, so it will not hide the original version string of other assets.

    Thanks. I was looking for this solution too. Glad you found out which plugin was causing it.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘WP adds long version query strings to CSS and JS files’ is closed to new replies.