How You Can Prevent Hotlinking


Hotlinking happens when someone displays an image from your site by using its web link directly. They get to display the image on their website and have it sourced from your website. The image is extracted from the source website’s server each time it loads.

That can happen without your permission and maybe even without your knowledge.

For a simple analogy to explain hotlinking, imagine if someone used your fuel for their car. They’d be hotlinking your car’s fuel to make their own car run. Quite clearly, that’s not right.

In this article, we’ll explore the topic of hotlinking. You’ll learn what it is, why it happens, why it should be prevented, and the steps you can take to avoid it. You’ll discover how to stop others from using your content and ensure you don’t engage in hotlinking yourself.

Hotlinking involves a person copying the URL of an image and embedding it on their website, causing the image to display as if it was their own content. When a visitor browses the website, the hotlinked image will be retrieved from the source site via the copied URL.

It’s important to mention that hotlinking is basically one step worse than copyright infringement. It would happen if, instead of just linking to an image, you downloaded and used it as if it were yours, without crediting the owner. When hotlinking occurs, the culprit uses a web link or URL to reference the image and may or may not identify the source.

Why Does Hotlinking Happen and Why Is It Bad?

In many cases, hotlinking is unintentional. The hotlinker knows what they’re doing, but they don’t know it’s wrong.

These people don’t realize that hotlinking can be very expensive for the image owner. Consider what it would be like if someone borrowed content you created or paid for and used your server resources to do it! They’re freeloading, ignoring your investment into your site’s content, and leeching off your server resources.

Prevent Image Hotlinking
Image credit: Ravi Chahar

In most cases, hotlinking is also illegal. When you buy a photo from a stock photo website. The license is for you alone, not for anyone who decides to copy the image URL and use it themselves. You must protect your legal rights as a license holder.

As if having your content used without permission isn’t bad enough, if many people hotlink to your images, it can put a lot of pressure on your website’s server. This could cause your site to crash, and users will be turned away.

How to Disable Hotlink Protection

You can take many hotlinking prevention steps, and this section will describe several of the most effective ones.

Some of these tips involve finding an image of yours that has already been hotlinked, so “prevention” may not be the right word. Nevertheless, considering that most of the damage caused by hotlinking is tied to the ongoing use of your content, it’s wise to find hotlinking early and stop it before it causes a problem.

1. How Do I Find Hotlinks?

The most important thing you can do to avoid becoming a victim of hotlinking is to know it’s happening as soon as it starts. Figuring out if someone is hotlinking your images isn’t always easy. In some cases, you’ll never know it’s happening. However, running a few simple tests can help.

One way to find out if your content is hotlinked is to use Google Images. Using the following command, you can make Google search for your images on all other URLs across the internet.

inurl:yourwebsite.com -site:yourwebsite.com

This search will scan the internet for all images being used with your URL. You’ll be able to visit the site where the images are being used, making it easy for you to pinpoint who the hotlinking culprits are.

2. Add a Disclaimer Under Each Image

Like people who use signs in their yard to let others know it’s private property, you can add disclaimers under your images to highlight the fact that they’re not meant for use by other people.

You can choose any wording you want for a disclaimer, mentioning your legal rights of ownership and the penalty that will be enforced if someone uses the image. Disclaimers will tell everyone not to hotlink your content, and they don’t take long to write, so this is an easy step.

Disable hotlinking in WordPress to protect your site
Image credit: Shout Me Loud

3. Get Hotlink Protection From Your CDN

You can use the hotlink protection offered through the CDN that your website runs on. This feature will prevent your website’s content from being displayed on other sites, including Pinterest, which sees a substantial amount of hotlinking.

You can also enable hotlinking protection on your server, not just the CDN, so your content and all the channels it serves will be 100% secure.

4. Employ WordPress Plugins for Hotlink Protection

Using WordPress plugins, you can add a layer of security to your website. The All in one WP Security & Firewall plugin has a built-in hotlinking prevention feature.

You can also use the plugin to disable the right-click option on your images. Disabling the right-click option makes it harder for people to copy the link to your image.

5. Rename Your Image Files

If someone hotlinks one of your images, a smart approach is simply changing the image’s URL. Then, hotlinkers will not be able to display the image because the link they used will be wrong. Instead of displaying your image, their site will display a 404 Error, but that’s the hotlinker’s problem!

Renaming your images is a great prevention step too. As a website owner, you should regularly rename your site images, which will help you avoid having your content hotlinked.

Threaten Hotlinkers with a DMCA Notice

6. Threaten Hotlinkers with a DMCA Notice

If you know who the hotlinkers are, you can approach them directly and request that they stop using your content. If they don’t listen, you have the Digital Millennium Copyright Act (DMCA) on your side. You can use it to force a hotlinker to stop using your images on their site.

It will be taken very seriously if you issue a warning that references the DMCA. They’ll know you aren’t messing around and there will be serious consequences if they ignore the warning. 

When they’re faced with a genuine fear of being fined or blocked or having their website suspended, hotlinkers will remove the links to your images fast.

7. Block Specific Domains

Another trick is simply blocking specific domains from using your content. You could list websites, competitors, or hackers that you suspect would be interested in using your images and then block them.

This technique is a good preventative step. If your list of domains to block is comprehensive, you can make this work.

8. Add Code to Your .htaccess File

Our last suggestion for protecting your site from hotlinking is to add specific code to your website. You can use the following code snippet:

RewriteEngine on 

RewriteCond %{HTTP_REFERER} !^$ 

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

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

Replace “example.com” in the code snippet above with your website’s URL. You can also edit the snippet to serve hotlinkers alternative content, like another image. For example, while all legitimate users will see your licensed image, you can send hotlinkers an angry emoticon. That will drive home the point that you don’t want them to use your images.

If someone hotlinks one of your images, you can simply change its url.

Frequently Asked Questions

This subject yields many questions asked on the internet by users about Hotlink protection. Now, let’s answer the most frequent ones that appear.

What Is Hotlink Protection in cPanel?

Preventing Hotlink from inside your dashboard is possible. It has a security feature in cPanel designed to reduce bandwidth usage.

In the example below, we will use the HostPapa account dashboard. Follow the steps:

  1. Log in to your HostPapa Dashboard 
  1. Click on My cPanel.
  1. Scroll down to Security and click on Hotlink Protection.
  1. Click the Enable button to start protecting your bandwidth.
  1. Now, review the list of permitted URLs lower down the page. Most popular image types are blocked by default, but you can add any file extension here to protect your media.

After you finish it, just click on submit.

Should I Disable or Enable Hotlink Protection?

Hotlinking another website’s images can elevate the bandwidth on its server and, sometimes, have copyright issues. It’s unethical and illegal, and you can overload the server of other people’s websites. Therefore, we advise you to disable hotlinking.

Take Action Against Hotlinking!

If you take the steps we suggested above, you can avoid being a victim of hotlinking. You’ll protect the website content you created or licensed and provide your customers with a unique browsing experience. Plus, your hosting provider will be happy because no one will be able to misuse the server resources that your site runs on.
Have you ever been a victim of hotlinking, or do you have your hotlink protection enabled?

María is an enthusiast of cinema, literature and digital communication. As Content Coordinator at HostPapa, she focuses on the publication of content for the blog and social networks, organizing the translations, as well as writing and editing articles for the KB.

decorative squiggle

Skyrocket your online business with our powerful Shared Hosting

Shared Hosting from HostPapa is suited for all your business needs! No‑risk 30‑day money‑back guarantee. 99.9% uptime guarantee. 24/7 support. Free setup & domain name.†

Related Posts

HostPapa Mustache