How to Prevent Image Hotlinking in WordPress

Do you want to prevent image hotlinking in WordPress? If you are looking for a step-by-step guide, keep reading this article. Here, we will share how to prevent image theft in multiple ways.

But before going further, let’s see what’s hotlinking and why it matters.

What is Hotlinking?

Hotlinking is a type of bandwidth theft that involves displaying an image on another website by linking it directly from its source. This means the image file remains hosted on your server but displayed on a different site, using up your hosting bandwidth.

To clarify further, when someone hotlinks to one of your images, they steal from you without giving any credit. This unethical practice can also result in copyright issues if the images don’t fall under Creative Commons or other open licenses.

Also, hotlinking can cause security risks as hackers may exploit loopholes in code to gain access through linked files. Therefore, website owners need to take proactive measures to prevent hotlinking.

Why Prevent Image Hotlinking in WordPress?

While hotlinking may seem harmless at first glance, it can negatively affect your website and business.

Firstly, hotlinking can use significant bandwidth from your web hosting account. When other websites link to images stored on your server, they steal resources from you without permission.

Secondly, hotlinked images can negatively impact the loading speed of your website for visitors. If multiple sites pull resources from one site, it slows down all the websites involved.

And lastly. hotlinked images might be used as copyright infringement or malicious intent, like displaying inappropriate or harmful content with your brand’s name attached.

All in all, preventing image hotlinking reduces all these problems mentioned above by blocking requests for images that don’t come directly through pages hosted within WordPress – resulting in faster load times and less stolen bandwidth.

How to Spot if Someone Is Using Your Images Through Hotlinking?

As we saw what hotlinking is, it is a severe problem for website owners who put in the effort to create unique and engaging images. Fortunately, there are ways to spot if someone is using your pictures through hotlinking.

  • Check weblogs: One way is by checking your website traffic logs or analytics tools. Look for unusual spikes in bandwidth usage that could indicate an increase in image requests from other websites.
  • Reverse Image Search: Use tools like Google Images to perform a reverse image search. This will show you where your images are on other sites, making it easy to identify if someone has been hotlinking them without permission.
  • Additional Tools: You can use a tool like Copyscape to detect when someone uses your images without permission.
  • Watermark Images: With the right tools, you can detect hotlinking by setting up a “watermark” on your images. This will make it easy to spot if someone uses your images without permission, as the watermark will be visible on any website.
  • Overlays: You can add overlays or tracking codes to your images before uploading them on WordPress. These measures make it easier to track where the photos are and prevent unauthorized use of your content.
  • Dedicated Plugin: Finally, you can use plugins like Hotlink Protection to block other websites from accessing your images. This plugin will detect any attempts to hotlink your content and stop them.

It’s essential as a website owner to protect your intellectual property and take action against those who engage in hotlinking without permission. By following these methods, you can easily spot any instances of hotlinked content, allowing you to take appropriate steps toward preventing further misuse of your work.

How to Prevent Image Hotlinking WordPress?

By now, you should understand what image hotlinking is and why it’s essential to prevent it. Fortunately, there are several methods that you can use to avoid hotlinking images on your WordPress website:

  • Modify the .htaccess file
  • Use content protection plugins
  • Watermark your images
  • Use a CDN
  • Change the file name
  • DMCA takedown

Below, we will mention how to protect your images in different ways.

1) Add Rewrite Rules to Your .htaccess File

One of the easiest ways to prevent image hotlinking in WordPress is by adding code to your .htaccess file. This file is located in the root directory of your WordPress installation and can be accessed through your hosting provider’s control panel.

You can add code to your .htaccess file that checks the referrer of the image request and only allows requests from your website while blocking incoming requests from other domains for specific file types, such as images.

Here’s the code which blocks access to your images on websites other than your social media. You’ll see an additional line with an illustration of a different website that is whitelisted.

/* Prevent image hotlinking in WordPress */
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?whitelisted-websites [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ - [F]

2) Using Dedicated WordPress Plugins


Another effective method is to use plugins designed explicitly to prevent image theft and hotlinking. Popular options include WP Content Copy Protection & No Right Click, which disables right-click functionality and discourages users from copying or saving images directly from your site.

Another useful plugin is the Hotlink File Prevention plugin, which prevents other websites from hotlinking your images. This plugin creates a whitelist of websites that are allowed to hotlink your images while blocking all other websites.

3) Watermarking Tools


You can also use watermarking tools or services that automatically add a visible overlay to your images with copyright information or branding. While this won’t stop hotlinking, it makes it more difficult for others to pass off your content as their own.

4) CDN with Hotlinking Protection

Consider using a content delivery network (CDN) like Cloudflare, which provides additional layers of security against hotlinking and other forms of website abuse. With these methods in place, you’ll have greater control over how your images are used online and be better protected against unauthorized usage.

5) Change your File Name

If you unexpectedly find large traffic to your site or many sites hotlinking to a single image, then renaming the file is a simple and quick option. By doing so, the photos to the end of the hotlinks change into 404 errors. This technique is helpful, but it’s more of a band-aid than a foolproof defense against widespread hotlinking.

6) File DMCA Takedown Notice

This is the final thing you can do. You can file a DMCA takedown notice if nothing we mentioned above works. DMCA takedowns can be so helpful in most cases. People will remove copyrighted content immediately because they do not need to face any legal action.


In this article, we have discussed different methods to prevent image hotlinking. Preventing image hotlinking may seem minor at first glance, but it can seriously affect your website’s performance and reputation.

By taking proactive steps to prevent hotlinking on your site, you’ll be protecting yourself from unauthorized use of your images, bandwidth theft, and other potential legal issues while ensuring that visitors view your content in the way intended – directly on your site!

All the methods that we mentioned are easy to apply. Choose one of them and ensure that your images are used only with your permission.

We are open to any questions or suggestions if you have any other measures to prevent hotlinking in WordPress. For that, please leave a comment below.

Meanwhile, here are some other posts related to WordPress that you may find helpful.