Correct Poor Query Strings

Improve your WordPress site's performance score. This code snippet will fix Poor Query Strings issue that GT Metrix detects.

When optimizing page speed, you will often get an issue related to query strings ending with a question mark. This fixed it.

Add the following code snippet to your theme functions.php file

/** THIS IS INTENDED TO IMPROVE THE POOR QUERY STRINGS ISSUE AT GT METRIX **/
function pu_remove_script_version( $src ){
    return remove_query_arg( 'ver', $src );
}
add_filter( 'script_loader_src', 'pu_remove_script_version' );
add_filter( 'style_loader_src', 'pu_remove_script_version' );

Hire WordPress Experts at Codeable.

The only WordPress exclusive freelancer platform that connects thousands of customers with the top WordPress freelance experts to work on projects of any size. 

Free estimate • No obligation to hire • 100% risk-free