How to Remove Query Strings from Static Resources without a
Estimated reading time: 2 min read|289 words
Quick Answer
To Remove Query Strings from Static Resources without a Plugin simply copy paste below code in your theme’s functions.php //Remove Query Strings…
To Remove Query Strings from Static Resources without a Plugin simply copy paste below code in your theme’s functions.php //Remove Query Strings…
Last Updated: August 7, 2026
To Remove Query Strings from Static Resources without a Plugin simply copy paste below code in your theme’s functions.php
//Remove Query Strings From Static Resources
function smartwp_remove_query_strings_from_static_resources( $src ) {
if( strpos( $src, '?v=' ) ){
$src = remove_query_arg( 'v', $src );
}
if( strpos( $src, '?ver=' ) ){
$src = remove_query_arg( 'ver', $src );
}
return $src;
}
add_filter( 'script_loader_src', 'smartwp_remove_query_strings_from_static_resources', 999 );
add_filter( 'style_loader_src', 'smartwp_remove_query_strings_from_static_resources', 999 );Thats it now your static resources no longer have query strings attached to them!
Most Viral Tool - free SEO audit tool Tool | AI resume tailor tool-tailor">ATS Resume Generator| Reseller Profit Tracker Generator | Freelance Invoice Generator | ADHD Planner Generator
Advertisement
Thank you for reading this post, don't forget to subscribe!


![Real Estate Development In The Metaverse[year]](https://share-ask.com/wp-content/uploads/2023/03/Real-Estate-Development-In-The-Metaverse.jpg)







