Dec 02, 2025
Hasna A.
6min Read
Hotlinking is when someone embeds an image or media file from your website onto theirs by linking directly to your file’s URL. Instead of uploading the image to their own server, they use yours, forcing your server to do the work and deliver the file to their visitors.
This practice represents a problem because it effectively steals your bandwidth, which can drive up your hosting costs and slow down your website for your actual visitors. Think of it like a neighbor powering their holiday lights with your electricity, while you pay the bill.
It can also constitute copyright infringement if done without permission, creating potential legal issues and ethical concerns.
Fortunately, protecting your site is straightforward. You can prevent hotlinking by enabling protection through your hosting control panel, editing your site’s .htaccess file, using a Content Delivery Network (CDN), or installing a simple WordPress plugin.
Website owners are the most affected ones when hotlinking occurs. For those who do it, hotlinking might seem like an easy way to acquire website assets, but in reality, hotlinking can harm them too.
Let’s go over the five main reasons why you should avoid hotlinking:
No hotlinking is a technical barrier that prevents other websites from embedding your media files directly.
When enabled, if someone tries to link to your image, it will either appear as a broken image on their site or be replaced by a different image you specify, like one that says Image stolen from [Your Website].
Hotlinking isn’t explicitly illegal, so it often falls into a legal gray area. However, it’s widely considered unethical and unprofessional because it almost always results in copyright infringement.
When you display a hotlinked image, you show copyrighted content on your site without a license, violating the owner’s rights and forcing them to pay for your website’s traffic.
Now that you’ve learned why you should stop hotlinking, you might be wondering what to do instead when you want to use images from other websites.
The most important part is making sure that you’ve been given the authorization to use the image. You can often acquire images by simply asking for the owner’s permission. Others are under a strict legal license – for example, copyrighted photographs.
Once you’ve received the permission or taken care of the legal process, you should upload the file to your own host or use a third-party provider. For images, use an image hosting service like Imgur. This way, you won’t be stealing bandwidth from the original website owner.
If, for any reason, you can’t acquire the image you want, try these alternatives:
Putting hotlink protection in place is very important to prevent content and bandwidth theft issues.
Before proceeding, remember that hotlink protection won’t hurt your website’s presence in search results. As long as you don’t block search engines from indexing your images, your search engine optimization (SEO) efforts will be unaffected.
Let’s go over four different methods to protect your assets from getting hotlinked.
If you host your website on Hostinger, you can set up hotlink protection right from hPanel. The process should be similar on other control panels. Follow these steps:


Another option is to edit your website’s .htaccess file by accessing it through an FTP client like FileZilla or the file manager on your hosting account’s control panel.
This method involves editing your website’s code, so be careful – a small error can render your site unusable.
RewriteEngine onRewriteCond %{HTTP_REFERER} !^$RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?google.com [NC]RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?bing.com [NC]RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?yahoo.com [NC]RewriteCond %{HTTP_REFERER} !^http(s)?://(www.)?yourdomain.com [NC]RewriteRule .(jpg|jpeg|png|gif)$ – [NC,F,L]Using a content delivery network (CDN) for your website has many benefits. A CDN can increase content delivery speed, providing better performance for your visitors. It can also offer asset management features for website administrators, including hotlink protection.
Activating hotlink protection will vary depending on the CDN provider you use. Let’s explore how to set up hotlink protection on two popular CDN providers – Cloudflare and KeyCDN.
Here’s how to activate hotlink protection on Cloudflare:


The Scrape Shield app by Cloudflare specifically prevents image hotlinking and supports .gif, .ico, .jpg, .jpeg, and .png file types.
Here’s how to activate hotlink protection on KeyCDN:


If you use WordPress as your website’s content management system (CMS), several plugins can prevent hotlinking. We’ll go over three of them.
The first is the All In One WP Security and Firewall plugin, which can automatically edit your website’s .htaccess file to prevent hotlinks. Follow these steps to set it up:

Another plugin you can use is WP Content Copy Protection & No Right Click. This plugin can block visitors from copying text and right-clicking on your website. If you enable the right-click prevention, your visitors won’t be able to find or save the direct link to your content files.
Here’s how to enable the right-click protection on your site using this plugin:

Secure Copy Content Protection and Content Locking is another option to disable right-click and asset copying. Here’s how to set it up:

Preventing hotlinking is an essential form of site optimization, but it’s just one part of keeping your site fast and efficient.
Other methods include caching your pages, compressing images, minifying CSS and JavaScript files, and using a lightweight theme.
By following the best WordPress optimization practices, you can improve everything from load times to search engine rankings, giving your visitors the best possible experience.
To protect all the work you’ve put into your site, download a website backup regularly and learn the first steps to take if you ever need to diagnose and fix a hacked website.
All of the tutorial content on this website is subject to Hostinger's rigorous editorial standards and values.