WebMastering

How To Redirect Traffic From Google Images

jeremy / April 7, 2015

If you get a lot of traffic from Google images and want to redirect to a page where is actual image located (instead of letting Google shows image in iFrame) you can use code I’ll share with you.

Depending on platform you use, you can insert this piece of code in Blogger but on other side, if you want to apply this to WordPress blog, I will share with you plugin you can upload and install.

Inserting code in Blogger (blogspot)

Login to your blogger account and select blog you want this change to be applied. On left side select Template > Edit HTML

You will be asked are you sure you want to make changes directly to code, just click Proceed to proceed.

Now find </head> and copy this code right below closing </head> tag in your code.

<script type='text/JavaScript'>if (parent.frames.length > 0)top.location.replace(document.location);</script>

or use this code just in case previous one doesn’t work:

<script language='Javascript'>if(parent.location != self.location){parent.location=self.location;}</script>

If you have problems with viewing code click here to see code in text file:

Link to codes in txt file (opens in new tab)

Here is image to help you understand this information better.

Save template and test it by searching for keywords on Google Images you know you are ranking for.

WordPress plugin

But if you use WordPress you can use this small php file which should be installed as plugin:

http://www.codetrax.org/attachments/download/19/break-out-of-frames.zip

Do you get a lot of traffic from Google Images?

1 thought on “How To Redirect Traffic From Google Images

Leave a Reply