WordPress Not Removing Query String From Static Resources
-
Hi LS Team
Report number: XFTDGFTE
Report date: 04/03/2022 04:00:13In my website, i have enabled remove query string from static resource
Still when i visit my website from any incognito tag, i can see the js and css files are loading with ?ver=some_random_string query parameter appended.
I have tried below methods.
1. Enabled Drop Query String in LS Cache Section under
Cache>Drop Query String
and addedver*
as a parameter2. Installed a third-party query string removal plugin
3. Tried Querysting Removal Method by adding code to function.php provided by Kinsta Blog
function remove_query_strings() { if(!is_admin()) { add_filter('script_loader_src', 'remove_query_strings_split', 15); add_filter('style_loader_src', 'remove_query_strings_split', 15); } } function remove_query_strings_split($src){ $output = preg_split("/(&ver|\?ver)/", $src); return $output[0]; } add_action('init', 'remove_query_strings');
4. Tried random string removal method by using diffchecker and didn’t found anything using this
?LSCWP_CTRL=before_optm
all of these 4 method didn’t solve my issue.
My Webserver is Openlitespeed. Due to this issue my css file storage kept increasing. and it’s generating for each page
for example here is the screenshot: https://ibb.co/kJM3pNk
from the screenshot you can see it’s mainly generating 2 css file of same size, multiple times.I checked both version of css and they are same as per diffchecker.
Please help me remove the ?ver query string. This thing filling up disk space quickly
- The topic ‘WordPress Not Removing Query String From Static Resources’ is closed to new replies.