Hello,
Thanks for contacting us.
Can you provide information on which query string you are referring to?
The query string is appended to the images in the Media Library, here is a sample:
?_t=1722894832
?_t=1722894964
Plugin Author
WP Zone
(@aspengrovestudios)
Hi, this query parameter is added by default in the admin to help prevent caching from causing issues when an image is changed – without it, the image may not switch to the new image for some time after the image is replaced.
It can be removed via the following (we’d suggest in the admin_init hook since only the admin should be affected by these hooks):
remove_filter('wp_calculate_image_srcset', 'hm_replace_image_calculate_image_srcset');
remove_filter('wp_get_attachment_image_src', 'hm_replace_image_get_attachment_image_src');
remove_filter('wp_prepare_attachment_for_js', 'hm_replace_image_prepare_attachment_for_js');
Is there a reason why you want to remove the query parameter? Is it causing problems?
I sometime copy the image url from the Media Library for frontend usage.
Thanks for providing the filters 👍🏽