Home Forums WoodMart support forum Remove query strings from static resources

Remove query strings from static resources

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #102027

    rupak
    Participant

    Hi!

    I checked my site in gtmetrix.com and found that there is problem with Remove query strings from static resources.

    After searching in google, I found the code and paste it in functions.php

    function _remove_script_version( $src ){
    $parts = explode( ‘?ver’, $src );
    return $parts[0];
    }
    add_filter( ‘script_loader_src’, ‘_remove_script_version’, 15, 1 );
    add_filter( ‘style_loader_src’, ‘_remove_script_version’, 15, 1 );

    But, the score is C in gtmetrix. Can you help me to get grade A rank for Remove query strings from static resources?

    #102039

    Artem Temos
    Keymaster

    Hi,

    Personally, we use WP Rocket plugin to optimize our website and it fixes this problem as well. Sorry, but we don’t know how the code you sent should work.

    Regards

Viewing 2 posts - 1 through 2 (of 2 total)