How to Remove Query Strings from Static Resources without a
Estimated reading time: 3 min read|428 words
Key Takeaways
- Core Concept: Explore insights on How to Remove Query Strings from Static Resources without a.
- Summary: 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',…
- Application: Apply these inspirational principles to improve personal and professional growth.
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!
Thank you for reading this post, don't forget to subscribe!








![The Ultimate Guide to Designing and Self-Publishing 5 The Ultimate Guide to Designing and Self-Publishing [Updated 2026]](https://share-ask.com/wp-content/uploads/2026/06/omafznyoy6e-800x450.jpg)
