Image Hotlinking, its effects on Your Website, and How to Prevent

Please Subscribe to our YouTube Channel

Image Hotlinking is one of the major concern for every webmaster. However, many new bloggers are not aware of this. So we will explain what is image hotlinking (also known as image theft), hot it affects your website and server, and how to prevent it?

What is Image Hotlinking?

Image Hotlinking is a way to use direct image URL from another website, and embed/use it on your own website. For example, You are posting an article with many images, and you use a direct image link from a site, and put it on your website to display. This way you don’t have to upload that image to your blog/website, and you can still use the image.

If you are new to the blogging, you might be thinking that this is good because you are getting a link from a different website. However, you should think that how such link can help you. An image link that looks like this “https://www.example.com/upload/images/example.jpg.” So this is just a link to the actual image, not the web page where that image appears.

How Image Hotlinking Affects Your Website, and Why You Should Not Allow This?

Image Hotlinking affects the performance of your website as well as Hosting Server. If a website is using direct image link from your website that means every time that image loads it will consume your hosting bandwidth. If you are using a hosting plan with limited Bandwidth, you are likely to get more bills because of others act that you are not responsible for. If images from your website are used by many webmasters, it will increase the load time of your website and make your blog/website slower. This is why you must put Image Hotlinking to an end to save bandwidth and keep your website perform well.

How To Put a Stop to Image Hotlinking and Bandwidth Theft via .htaccess File?

You can also use a Plugin if it allows editing .htaccess file, but doing it from Hosting Account is better. Follow these steps to edit .htaccess file to stop Image Hotlinking and Bandwidth Theft.

  • Go to your Hosting Account’s Control Panel.
  • Locate File Manager option, and click on it.
  • If you have hosted multiples website under one domain, make sure to go to the right folder to edit .htaccess file of the correct website.
  • Select .htaccess file, and download it to keep as a backup. If something goes wrong, you can upload it again to make things work.
  • Now click on .htaccess file to edit. If you face trouble, right click on .htaccess file and select Edit option.
  • .htaccess file may look like a notepad with some codings. Don’t remove anything, and go to the end of the page.
  • Copy the following code and paste in the end of the page, but before end of wordpress tag.

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain1.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain2.org [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?domain3.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ https://s30.postimg.org/q5w7cu28x/No_Image.jpg [NC,R,L]

  • Save it, and you are done.

Note about the code : 

  1. RewriteCond %{HTTP_REFERER} !^$ : Black Referrer is allowed. If you don’t want this, just remove this line.
  2. Replace Domain1.com with the name of your domain name, e.g. techgrapple.com. Domain2.com with another domain name. If you have just one website, remove the 2 lines that include domain2 and domain 3.
  3. Please note that the domain you mentioned in the code, the image will for that domain only.
  4. The last line of the code has a link to the picture that will be load don rest of the other websites if they hotlink your images.

How to Disable Image Hotlinking On WordPress Blogs

Wordpress Plugin to prevent image hotlink

  • Add All In One WP Security & Firewall plugin to your blog, and activate it.
  • Now click on WP Security option, and select Firewall option.
  • Now you will see many tabs, you need to select Prevent Hotlinks.
  • Enable the option “Prevent Image Hotlinking.
  • Click Save Settings.

Note : If you are using Jetpack WordPress plugin and Photon feature is enabled, then Image Hotlinking thing may not work. This is because the images are actually not loading from your server, but WordPress server. After enabling Photon feature every image you see on your website will have wp.com add before the URL. So the images even on your website are not using your hosting bandwidth.

Related; Watermark Images in Google Search