Menu Close

How to Prevent Hotlink in WordPress Websites ?

Posted in WordPress

You have worked so hard to build a beautiful website and a recognizable brand name with a unique domain name. You also spent time and effort to create eye catching graphics and designs for your website and social media accounts. But something strange has been happening, that beautiful website of yours has become slow, why? This could be hotlinking and you need a hotlinking protection.

What is Hotlinking & Why is it Bad?

Hotlinking refers to the practice of displaying an image or other media file on a website by linking directly to that file on another server, rather than hosting the file on the website’s own server. This can be done using the HTML img tag or by linking to the file in the website’s CSS (cascading style sheets).

There are a few reasons why hotlinking is generally considered to be bad practice:

  1. It can lead to bandwidth theft: When someone hotlinks to a file on a web server, they are effectively using the origin server’s resources to serve the file to their own website’s visitors. This can put a strain on your server and use up your bandwidth because of high traffic, potentially leading to additional costs for you.
  2. It can cause slow loading times: If the server hosting the hotlinked file is slow or overloaded, it can cause the website that hotlinked to the file to load slowly as well. This can be frustrating for visitors to the website and may lead to a negative user experience. Most of the time, people Hotlinking their websites out of laziness and to make things easier and fast unintentionally. And most of the time they are not even aware of the fact of hotlinking and how it can generate some serious issues. Either way, they are mostly busy writing content and simply copying image URLs from another website to their post. Even they do not have an idea about how to properly copy anything without removing any trace. However, all these practices are not acceptable or treated as an excuse, because even they are not even following the right strategy to write content. And understanding the basics of writing content, i.e How to use images from other websites with providing proper citations and attributes.
  3. It can result in broken links: If the image hosting service provider changes the file’s location or removes it entirely, the hotlinked image file will no longer be accessible, and the file type (image or other media) will not be displayed on the website that hotlinked to it. This can make the website appear broken or incomplete.

Is hotlinking legal?

Hotlinking itself is not necessarily illegal, but it can potentially be a violation of copyright law if the website owner does not have permission to use the hotlinked file. In general, it is considered good practice to obtain permission from the owner of the file before using it on your website, whether you are hosting the file on your own server or hotlinking to it.

In the United States, copyright law allows for the use of a copyrighted work without permission under certain circumstances, such as for the purpose of criticism, commentary, news reporting, teaching, scholarship, or research. However, these exceptions to copyright law are narrow and do not apply to all situations. In general, it is always a good idea to obtain permission from the copyright owner before using someone else’s work, even if you believe you are covered by one of the exceptions to copyright law.

In other countries, copyright law and the rules surrounding hotlinking may vary. It is always a good idea to familiarize yourself with the specific laws and regulations in your own country before using someone else’s work on your website.

You may have even noticed on pictures that are posted on different websites, usually have some copyright and license restrictions imposed on them.

Below are some examples of image licensing you may find:

  1. No unlawful use
  2. No sensitive use without a disclaimer
  3. No commercial use of editorial content
  4. No standalone file use
  5. No alteration of editorial content

If the above-mentioned image usage restrictions are imposed, No one has the right to use the image legally. Hence if anyone tries to do so, they have to face some legal actions against them. However, generally, these restrictions can be easily broken if anyone uses a website URL on their website from the original one.

Why Should you Avoid Hotlinking?

There are several reasons why you may want to avoid hotlinking:

  1. Bandwidth theft: Hotlinking can lead to bandwidth theft, where someone else is using your server’s resources to serve the hotlinked file to their own website’s visitors. This can put a strain on your server and use up your bandwidth, potentially leading to additional costs for you.
  2. Slow loading times: If the server hosting account which the hotlinked file comes from is slow or overloaded, it can cause your website to load slowly as well. This can be frustrating for your website’s visitors and may lead to a negative user experience.
  3. Broken links: If the server hosting the hotlinked file changes the file’s location or removes it entirely, the hotlinked file will no longer be accessible, and the image or other media will not be displayed on your website. This can make your website appear broken or incomplete.
  4. Potential copyright violations: If you do not have permission to use the hotlinked file, or if you do not properly credit the original source, you may be in violation of copyright law. This could lead to legal issues and potential fines.
  5. Lack of control: When you hotlink to a file, you are relying on another server to serve the file to your website’s visitors. If that server goes down or has technical issues, it can affect the display of the hotlinked file on your website. By hosting the file on your own server, you have more control over its availability.

Note: Broken links and slow loading time on your web pages can affect your Search Engine (SEO) score because Google images would consider your website a hazard to users and not recommend it.

Effect of Hotlinking on SEO

Restricting other users from hotlinking your images on their website actually won’t affect your SEO, but only when it is done properly. You cannot simply just block everyone to read or detect your website URL, it is because Search engines like Google and Bing have crawlers who need access to your content and images for indexing them into SERPs.

All these happen, when you try to search anything on Google images, there a list of relevant image search results will appear according to the keywords you were searching for. And then Google will only show the thumbnails of the images of the relevant keyword in the search results. The original images of the search results are still stored on the original server.

What is Hotlinking Protection & How to Protect yourself From Hotlinking?

Hotlinking protection is a measure that website owners can take to prevent other websites from hotlinking to their files. There are several ways to protect yourself from hotlinking:

(1) Use a content delivery network (CDN):

A CDN is a network of servers that are distributed around the world and are used to deliver content to users based on their geographic location. By using a CDN, you can reduce the load on your own server and protect yourself from hotlinking.

(2) Block Hotlinking Through your .htaaccess File

You need a htaccess file editor plugin. Enable the htaccess file editor plugin, open the .htaccess file editor plugin, after #END WordPress line, Add Following line:

Use .htaccess: If your website is hosted on an Apache server, you can use the .htaccess file to block hotlinking. You can do this by adding the following code to your .htaccess file:

RewriteEngine on

RewriteCond %{HTTP_REFERER} !^$

RewriteCond %{HTTP_REFERER} !^http://(www\.)?example.com/.*$ [NC]

RewriteRule \.(gif|jpg|jpeg|bmp|zip|rar|mp3|flv|swf|xml|php|png|css|pdf)$ – [F]

This code will block hotlinking to files with certain file extensions (such as .jpg, .png, and .gif). You can customize the list of file extensions to suit your needs. example.com is your own domain that do not allow hotlink.

(3) Rename/Remove Hotlinked Files

There are a few different ways to rename or remove hotlinked files:

  1. Rename the file: If you want to keep the file but prevent others from hotlinking to it, you can rename the file on your server. This will break the link that other websites are using to hotlink to the file, and the file will no longer be displayed on those websites.
  2. Remove the file: If you no longer want the file to be available on your server, you can delete it from your server. This will prevent others from hotlinking to the file and will also remove the file from your own website if you are using it.

Renaming or removing hotlinked files can help to protect your website’s resources and prevent unauthorized use of your files.

(4) Add Watermarks to your Media Assets

Use watermarks: If you do not want to prevent hotlinking altogether, you can use watermarks to protect your images and other media files. A watermark is a visible mark or logo that is added to an image or other media file to identify the copyright owner. This can help to deter others from using your images without permission.

(5) Disable Right-Click Functionality on WordPress

Disabling right-click functionality does not necessarily protect you against hotlinking but it helps users access to some features on your website like copying a text, saving an image, and most importantly, just copying the image and pasting it on their website. This is a great asset for network security.

(6) Use a WordPress Plugin

There are several WordPress security plugins available for WordPress that can help to protect your website from hotlinking. These plugins can make it easy to block hotlinking and customize the settings to suit your needs.

Prevent Hotlinking by using WordPress All-in-one WP Security and Firewall plugins

All-In-One Security (AIOS) – Security and Firewall
All-In-One Security (AIOS) – Security and Firewall

If you are a WordPress user, there is always a plugin that will exist for any kind of problem you face. Similarly, for hotlinking, there are certain WordPress plugins available that help you out with this situation. All-in-One WP Security and Firewall plugin is an outstanding all-in-one security solution that has also a built-in feature of hotlinking prevention.

But one thing you must keep in mind is that protecting your website from the server side is highly advisable other than using plugins.

AIOS Hot Link Setting

AIOS Hot Link Prevention Setting
AIOS Hot Link Prevention Setting
  1. Filesystem Security
  2. File Protection
  3. Prevent Image Hotlinking

 

Hotlinking Frequently Asked Questions

Answers to your frequently asked questions:

Should I disable hotlinking?

Whether or not you should disable hotlinking on your website depends on your specific needs and circumstances. Here are a few things to consider when deciding whether to disable hotlinking:

  1. Bandwidth usage: If you are concerned about conserving bandwidth on your server, you may want to disable hotlinking to prevent others from using your server’s resources to serve files to their own website’s visitors.
  2. Cost: If you are paying for bandwidth or other server resources, hotlinking may result in additional costs for you if others are using your resources to serve their own files. In this case, you may want to disable hotlinking to reduce these costs.
  3. User experience: If you are concerned about the loading times on your website, you may want to disable hotlinking to prevent slow loading times caused by servers that are hosting the hotlinked files.
  4. Control: By disabling hotlinking, you have more control over which files are displayed on your website and how they are served to your visitors.

Ultimately, the decision to disable hotlinking is up to you and should be based on your specific needs and goals for your website. There are several methods you can use to disable hotlinking, such as .htaccess, a content delivery network (CDN), the “Referrer” header, watermarks, or a plugin. These methods can help to prevent unauthorized hotlinking and protect your website’s resources.

How do I turn off hotlink protection in WordPress?

To turn off hotlink protection in WordPress, you can use a plugin or modify the .htaccess file on your server.

Here’s how to turn off hotlink protection using a plugin:

  1. Install and activate the “WP Fastest Cache” plugin: In your WordPress dashboard, go to “Plugins > Add New” and search for “WP Fastest Cache.” Install and activate the plugin.
  2. Go to the plugin’s settings: In the left menu of your WordPress dashboard, go to “WP Fastest Cache > Settings.”
  3. Navigate to the “Prevent Hotlinking” tab: In the plugin’s settings, click on the “Prevent Hotlinking” tab.
  4. Select the “Disabled” option: In the “Hotlink Protection” section, select the “Disabled” option.
  5. Click the “Submit” button: Click the “Submit” button to save the changes.

This will turn off hotlink protection for your WordPress website.

Leave a Reply