How To Prevent Hotlinking Inside Your WordPress Blog

Hotlinking is a term used when an image from your site used in other site without changing its URL. The main disadvantage of hotlinking is your bandwidth used on another website. So ultimately it creates load on server.

To understand hotlinking you may assume any image with URL

Suppose any other user upload this picture and instead of hosting this image to his own site he link the image  to its original URL then whenever the image will open it use bandwidth of Blogtechnika instead of his site. So it will effect the speed of server. Sometimes it may effect the load time of your website.


You can prevent hotlinking of your website by using .htaccess method. You can also check my previous article  on .htaccess method on How To Restrict WordPress Admin Use By IP Address.For those who don’t know about .htaccess files please refer to my previous article.

1) Create a small image of any format, telling no hotlinking please.


2) Check the root folder of your blog. If there is any .htaccess file then open it on any text editor. Now copy and paste a code on  .htaccess file .

RewriteEngine On
#Replace ?mysite\.com/ with your blog url
RewriteCond %{HTTP_REFERER} !^http://(.+\.)?mysite\.com/ [NC]
RewriteCond %{HTTP_REFERER} !^$
#Replace /images/nohotlink.jpg with your "don't hotlink" image url
RewriteRule .*\.(jpe?g|gif|bmp|png)$ /images/nohotlink.jpg [L]

Now load this file to the root folder of your blog. All done.

via Wprecepies

Subscribe to blogtechnika for more updates. Follow me on Twitter @techim.

15 Responses

  1. good ploy .. i have subscribed yr blog with google reader and you have full feeds in it .. but there is no images displayed in posts … so i feel if your google reader subscriber will have problems.

    but hot-linking will reduce your server burden for sure
    .-= Jaspal´s last blog ..100+ facebook apps for productivity and tools for achieving all your goals =-.

  2. I was not aware of this and what you said is really corret .. will update my htaccess right away.. Thankd for the share
    .-= Rajesh Kanuri´s last blog ..WordPress 2.9 Beta 2 is Available: Download & Explore =-.

  3. Informative stuff, I have never thought of this hotlinking concept. In fact I did use this type of hot linking when I was at blogspot, but now I’m using my own server though.
    Any ways that’s for the awesome article. I was also cautioned by Gagan (beepthegeek) but didn’t understand what he said at that point of time, and now its clear to me.

  4. i have hotlinked my site, but sometimes it will restrict others to use my images and in some case it wont, what to do. sometimes ppl can get the images, so iam always renameing the image link in particular period and its a burdern to me.
    .-= sriganesh´s last blog ..60 Cute Mascot Characters =-.

Leave a Reply

Your email address will not be published. Required fields are marked *