• I built a custom header, footer, and sidebar using Elementorvia Theme Panel > My Library > Add New. I’m trying to improve my page speed and GTMetrix list all problems with my site and the links causing the problems. There is a category on GTMetrix called “Remove query strings from static resources”. I actually have a score of 95% but I would like to fix anything that I can.

    My header and sidebar are showing up under this remove query string category. Unlike my custom footer, my header and sidebar have an image. I’ve already added some script to my functions.php file which got rid of all other links causing this “error” but the header and sidebar image still have the “?” in the link address.

    Does anyone know of a setting or fix to remove the “?” from the links to the images? I posted the link to the header image above – here is the image link for the sidebar image:
    https://i0.wp.com/fairmountpetservice.com/Blog/wp-content/uploads/2018/06/mypic4.jpg?fit=250%2C195&ssl=1

    The page I need help with: [log in to see the link]

Viewing 5 replies - 1 through 5 (of 5 total)
  • Hello,

    To remove the query string, you can use a performance/optimization plugin. Can you share your site link so that I can understand your query clearly and help you to resolve it?

    Thread Starter Jim

    (@kernix)

    Sorry, I just saw this reply – don’t know why I didn’t get an email. The performance plugins that I have are:

    – Autoptimize, Async Javascript, Leverage Browser Caching, Page Speed Optimization, Smush & WP Fastest Cache. I believe I have all the correct settings for them.

    Here is my blog link: https://fairmountpetservice.com/Blog/

    Try to use this plugin and let me know it helps you or not – Remove Query Strings From Static Resources

    Thread Starter Jim

    (@kernix)

    Another plugin? I really didn’t want to fix the problem that way.

    Try to use the below code. Add it to the functions.php file of the child theme and let me know it works or not.

    function _remove_script_version( $src ){ 
    $parts = explode( '?', $src ); 	
    return $parts[0]; 
    } 
    add_filter( 'script_loader_src', '_remove_script_version', 15, 1 ); 
    add_filter( 'style_loader_src', '_remove_script_version', 15, 1 );
Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Remove query strings from static resources: elementor’ is closed to new replies.