2

I was using wordpress 3.3 to power my website. I tested it with Page Speed and it gave me error "remove query string from URL).... The query string is a question mark which appears in the start of query paramter of the url.....

http://gizmocube.com/images/logo.png .... is outputted as ...

http://gizmocube.com/images/logo.png?9d7bd4

how do i get rid of this question mark.... any .htacess stuff... any help would be appreciated....

1
  • You should probably find out why that string is added in the first place. I don't think WP does that natively. Do you have some plugin installed that is designed to prevent image caching? Commented Mar 2, 2012 at 15:28

4 Answers 4

3

Do you have W3 Total Cache Installed ? (Wordpress Plugin) , If you do

Go to the Browser Cache Tab

Untick

Prevent caching of objects after settings change

Whenever settings are changed, a new query string will be generated and appended to objects allowing the new policy to be applied.

Clear the Cache then It's gone :) Hope this helps

-- Source Myself (Having the same issue myself )

Sign up to request clarification or add additional context in comments.

Comments

1

Go to the Browser Cache Tab > untick "Prevent caching of objects after settings change".

This will slove the issue.

Comments

0

Change your Permalink settings from the default with question marks to a format you prefer under /wp-admin/options-permalink.php

3 Comments

I don't see how this has to do with WP adding random stuff to image URLs?
Naah!! i know permalinks... they are completely fine... but A "?" MARK gets appended in front of many images, css and js.. i am using W3 Total cache ... could that cause the problem???
@ayoosh I saw some info on thumbnail images. Are these images smaller versions of the originals?
0

Add this code to your functions.php file, it works for my sites.

function _remove_script_version( $src ){
$parts = explode( '?ver', $src );
    return $parts[0];
}
 add_filter('script_loader_src','_remove_script_version', 15, 1 );
add_filter('style_loader_src','_remove_script_version', 15, 1 );

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.