Remove a query string added to WordPress URLs

I have to work with a WordPress installation that wasn’t mine, and I need to work out some things to optimize performance.

Among other things, I’ve found that almost every single URL, specially for static files, is appended with a query string, and it’s always the same:

Read More

And so on.

Does anybody know a plugin that can be causing this? I have the following installed, and i can’t find the one causing it or if it’s something else:

  • Advanced Custom Fields
  • Akismet
  • Category Post Widget
  • Contact Form 7
  • Envato WordPress Toolkit
  • Forms: 3rd-Party Integration
  • Google XML Sitemaps
  • LayerSlider WP
  • Ready! Backup
  • Ready! Backup PRO
  • Redirection
  • Remove query strings from static resources
  • Special Recent Posts FREE Edition
  • Twoot ToolKit
  • W3 Total Cache
  • Wickett Twitter Widget
  • WordPress-to-Lead for Salesforce CRM
  • WordPress HTTPS
  • WordPress SEO
  • WP-PageNavi

Related posts

2 comments

  1. You can remove query strings from theme resources (css and javascript files) with this in your theme’s functions.php file:

    // Remove Query Strings from enqueue scripts
    add_filter( 'style_loader_src', 'remove_query_string' );
    add_filter( 'script_loader_src', 'remove_query_string' );
    function remove_query_string( $url )
    {
        return remove_query_arg( 'ver', $url );
    }
    

    As for query strings from plugins, I assume that will be a similar fix in each plugin.

  2. Appending a version number as a URL query string is a common cache-busting solution.

    It looks like W3 Total Cache may be the culprit here. Their website says that one of the features is:

    • Browser caching using cache-control, future expire headers and entity tags (ETag) with “cache-busting”

    According to the author of the plugin, you can disable this feature:

    Uncheck the “Prevent caching of objects after settings change” option on the browser cache settings tab.

Comments are closed.