• Skip to main content
  • Skip to forum navigation

StudioPress

  • Shop for Themes
  • My StudioPress

Forum navigation

  • Home
  • General Genesis Discussions
  • StudioPress Themes
  • Genesis Blocks
    • Genesis Blocks
    • Genesis Custom Blocks
  • Retired Themes
  • FAQs
  • Forum Rules
  • Internationalization and Translations
  • Forum Bugs and Suggestions
  • Forum Log In

Are You Using The WordPress Block Editor?

Genesis now offers plugins that help you build better sites faster with the WordPress block editor (Gutenberg). Try the feature-rich free versions of each plugin for yourself!

Genesis Blocks Genesis Custom Blocks

Remove Query Strings Genesis

Welcome!

These forums are for general discussion on WordPress and Genesis. Official support for StudioPress themes is offered exclusively at My StudioPress. Responses in this forum are not guaranteed. Please note that this forum will require a new username, separate from the one used for My.StudioPress.

Log In
Register Lost Password

Community Forums › Forums › Archived Forums › General Discussion › Remove Query Strings Genesis

This topic is: not resolved

Tagged: remove query strings genesis

  • This topic has 3 replies, 3 voices, and was last updated 10 years, 7 months ago by aureliendebord.
Viewing 4 posts - 1 through 4 (of 4 total)
  • Author
    Posts
  • June 19, 2014 at 4:42 am #110530
    samw
    Member

    Hi

    Can anyone suggest the code to remove query strings in genesis.

    This code works in htaccess but it causes a drop in page speed as its using a rewrite
    <IfModule mod_rewrite.c>
    RewriteEngine On
    RewriteCond %{QUERY_STRING} !=""
    RewriteCond %{QUERY_STRING} !^p=.*
    RewriteCond %{QUERY_STRING} !^s=.*
    RewriteCond %{REQUEST_URI} !^/wp-admin.*
    RewriteRule ^(.*)$ /$1? [R=301,L]
    </IfModule>

    This code doesnt work at all but its WP specific
    // Remove query string from static files
    function remove_cssjs_ver( $src ) {
    if( strpos( $src, '?ver=' ) )
    $src = remove_query_arg( 'ver', $src );
    return $src;
    }
    add_filter( 'style_loader_src', 'remove_cssjs_ver', 10, 2 );
    add_filter( 'script_loader_src', 'remove_cssjs_ver', 10, 2 );

    The query strings are as follows:-

    Domain name removed and replaced with xx

    This need to have the query part removed as without it , the browser side cacheing cant pick these up even with an htaccess rule set. Thanks

    http://netdna.bootstrapcdn.com/font-awesome/4.0.3/css/font-awesome.css?ver=4.0.3
    http://netdna.bootstrapcdn.com/font-awesome/4.0.3/fonts/fontawesome-webfont.woff?v=4.0.3
    xx/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.css?ver=2.4.8
    xx/wp-content/plugins/wp-customer-reviews/wp-customer-reviews.js?ver=2.4.8
    xxwp-content/themes/minimum-pro/?ver=1.0
    xxwp-content/themes/minimum-pro/js/backstretch-set.js?ver=1.0.0
    xx/wp-content/themes/minimum-pro/js/backstretch.js?ver=1.0.0
    xxwp-content/themes/minimum-pro/js/responsive-menu.js?ver=1.0.0
    xx/wp-content/themes/minimum-pro/style.css?ver=3.0.1
    xx/wp-includes/css/dashicons.min.css?ver=3.9.1
    xx/wp-includes/js/comment-reply.min.js?ver=3.9.1
    xx/wp-includes/js/jquery/jquery-migrate.min.js?ver=1.2.1
    xx/wp-includes/js/jquery/jquery.js?ver=1.11.0


    SEO & Online Marketing Consultant

    Metta3 | G+ | LinkedIn

    June 20, 2014 at 6:35 pm #110872
    nutsandbolts
    Member

    You might try this plugin: http://www.yourwpexpert.com/remove-query-strings-from-static-resources-wordpress-plugin/

    It's very lightweight and does the job


    Andrea Whitmer, Owner/Developer, Nuts and Bolts Media
    I provide development and training services for designers • Find me on Twitter and Google+

    June 20, 2014 at 8:56 pm #110887
    samw
    Member

    Hi Andrea

    Many Thanks - I did come across this, was trying to avoid a plugin solution but will give it a test


    SEO & Online Marketing Consultant

    Metta3 | G+ | LinkedIn

    October 9, 2014 at 4:15 am #127188
    aureliendebord
    Member

    Hello everyone,

    Maybe it will help :

    If you are using W3 Total Cache, you have to tick off "Prevent caching of objects after settings change " in the "browser cache" section.


    Agence web Debord, building websites in France.

  • Author
    Posts
Viewing 4 posts - 1 through 4 (of 4 total)
  • The forum ‘General Discussion’ is closed to new topics and replies.

CTA

Ready to get started? Create a site or shop for themes.

Create a site with WP EngineShop for Themes

Footer

StudioPress

© 2025 WPEngine, Inc.

Products
  • Create a Site with WP Engine
  • Shop for Themes
  • Theme Features
  • Get Started
  • Showcase
Company
  • Brand Assets
  • Terms of Service
  • Accptable Usse Policy
  • Privacy Policy
  • Refund Policy
  • Contact Us
Community
  • Find Developers
  • Forums
  • Facebook Group
  • #GenesisWP
  • Showcase
Resources
  • StudioPress Blog
  • Help & Documentation
  • FAQs
  • Code Snippets
  • Affiliates
Connect
  • StudioPress Live
  • StudioPress FM
  • Facebook
  • Twitter
  • Dribbble