Direct answer: To stop hotlinking images, first find the pages embedding your files by checking your access logs for foreign referrers, then block those requests with Cloudflare Hotlink Protection, an .htaccess rule, or an Nginx rule. The fix takes minutes, stops the bandwidth drain immediately, and does not hurt your search rankings if search engines stay allowed.
Someone else’s page can show your photo without ever copying it. They simply point an <img> tag at the file on your server, and every visitor to their page downloads the image from you. Your hosting pays the bandwidth bill, your server does the work, and you may never notice until your host warns you about traffic you did not create. This guide shows you how to find hotlinked images, confirm the evidence, and stop the practice for good, with a real test run on this very site.
What is image hotlinking?
Hotlinking (also called inline linking) is when a website displays an image by linking directly to the image file hosted on someone else’s server, instead of uploading its own copy. The page belongs to the other site, but the image request goes to your server, so you serve the bytes and absorb the bandwidth cost.
Hotlinking is not the same as copying. A copy is a second file sitting on someone else’s hosting. A hotlink creates no copy at all: delete or rename the file on your server and the image breaks on their page instantly. That distinction decides the fix. If you are hunting for copies hosted elsewhere, read our guide to finding out if someone is using your photos online instead, this article is about live links to your files, not re-uploads.
Hotlinking is often accidental. A blogger copies an image address from your page and pastes it into their post without realising the image still lives on your server. Sometimes it is deliberate: a high-traffic site embeds your infographic because it is easier than hosting it. Either way, the cost lands on you. A single 250 KB banner viewed 2,000 times a day on someone else’s site uses roughly 15 GB of your bandwidth a month, and if a popular page embeds your image, the spike can be far worse.
There is also a control problem. Because the file is yours, you can change it at any time, and so can anyone who hotlinks it in reverse: the image on their page changes whenever you update the file. That is why the classic response to a hotlinker is to replace the image with a warning graphic. It works, but blocking the request cleanly is better.
How do you find websites hotlinking your images?
You do not need a special tool. Your server already records the evidence, and two free searches can surface the suspects. Work through these four checks in order, from the most reliable to the quickest.
1. Read your access logs for foreign referrers
Every image request your server receives carries a Referer header, the address of the page that asked for the image. When your own page loads your image, the referer is your domain. When another site hotlinks it, the referer is their domain. That mismatch is the fingerprint of a hotlink.
In cPanel, open Metrics > Visitors or Raw Access Logs and look for image files (ending in .jpg.png.webp or .gif) requested with a referer that is not your site. In a hosting dashboard such as Cloudflare Analytics, look at the top referrers for your image paths. Sort by request count: a hotlinker usually shows up as one foreign domain making hundreds or thousands of requests for a small number of files.
Two honest limits apply. First, the Referer header is optional: browsers in strict privacy modes and many mobile apps strip it, so logs undercount hotlinking and can occasionally misattribute a request. Treat a log entry as strong evidence, not a court verdict. Second, some referrers are legitimate, search engines, social networks and feed readers all fetch your images. Never block a referer until you have checked what it actually is.
2. Search Google Images for your own file addresses
Google Images can show you pages embedding your files. Search for:
inurl:yourdomain.com -site:yourdomain.com
Replace yourdomain.com with your own domain. The inurl: part finds images whose file address contains your domain, and -site: removes your own pages from the results. What is left is mostly pages on other sites that point at your files. Open each result and check the page source: if the image address starts with your domain, it is a hotlink. This check is quick but incomplete, Google only shows pages it has indexed.
3. Run a reverse image search on your most valuable images
A reverse image search finds pages showing your photo, whether they hotlinked it or copied it. Upload your original image or paste its address into Google Lens and TinEye, then open the matching pages and inspect the image address. If the address is your domain, it is a hotlink; if it is their domain, it is a copy. Our guide to checking whether someone is using your photos online walks through this step in detail. Start with the images that cost you the most, large banners, infographics and photographs that other sites would want.
4. Watch for a bandwidth spike with no matching traffic spike
If your hosting dashboard shows bandwidth climbing while your own page views stay flat, something else is consuming your files. Compare the two graphs over the same week. A gap between them is the classic symptom of hotlinking (or of a bot scraping your media library). Once you see the gap, go back to the access logs and find which files and which referrers account for the extra traffic.
Worked test: is this site protected against hotlinking right now?
Rather than describe the test in theory, I ran it on this site’s own files on 10 November 2026. The method is one anyone can repeat with the free curl command or an online HTTP header checker: request one of your image files four times, each time pretending the request came from a different page, and watch the server’s answer.
The test file was this site’s own banner for the article on telling whether a photo is real: how-to-tell-if-a-photo-is-real-banner.png, a 744,753-byte PNG in the WordPress uploads folder. Four requests were made, each with a different Referer header:
| Request pretended to come from | Server answer | What it means |
|---|---|---|
| This site’s own article page | 200 OK, full 744,753 bytes | Your own pages load the image normally. |
| A foreign site (example.com) | 200 OK, full 744,753 bytes | A stranger’s page can embed the file freely. |
| No referer at all | 200 OK, full 744,753 bytes | Direct visits and apps can load the file. |
| Google (google.com) | 200 OK, full 744,753 bytes | Search engines can fetch and index the image. |
The result is plain: every request was served in full, including the one from a foreign site. This site currently has no hotlink protection switched on. Any website could embed any image from imagesearchtechniques.co.uk today and this server would serve it without complaint. That is the honest finding, and it is also why this article exists: the fix is short, and the site will be protected once it is applied.
Note what the test does not prove. A 200 answer from a foreign referer proves the file is served to hotlinkers; it does not prove anyone is actually hotlinking it, because that needs the access logs. And a single file is a sample, not a survey: protection is usually set per file type across the whole site, so one unprotected PNG is a fair sign the rest are unprotected too, but only the logs can confirm the full picture.
Which fix should you choose?
Five methods stop hotlinking, and the right one depends on what you control. The comparison below weighs them on the things that matter: how hard each is to set up, whether it stops new hotlinks or only breaks existing ones, and what it can accidentally break.
| Method | Setup effort | Stops new hotlinks? | Breaks existing hotlinks? | Main risk |
|---|---|---|---|---|
| Cloudflare Hotlink Protection | One toggle, no code | Yes | Yes | Images stop showing on Google Images and Pinterest |
| .htaccess rule (Apache / LiteSpeed) | Copy a few lines | Yes | Yes | A typo can block your own images, test after saving |
| Nginx location rule | Edit server config, reload | Yes | Yes | Needs server access; a bad reload can stop the site |
| cPanel Hotlink Protection | A form in the dashboard | Yes | Yes | Only works if your host offers cPanel |
| Rename the file | Minutes per file | No | Yes, instantly | You must update every link on your own site too |
If you already use Cloudflare, start there: it is one toggle and it protects your images before requests ever reach your origin server. If you do not use a CDN, use the .htaccess rule on Apache or LiteSpeed, or the Nginx rule if that is your server. If you have no server access at all, use cPanel if your host provides it, and rename the file as an emergency fix for a single abused image.
The Ranking Asset for this article is the triage table below. Use it to turn whatever evidence you found into the right fix, in order, without guessing.
| What you found | How to confirm it is a hotlink | The exact fix |
|---|---|---|
| Bandwidth spike, no traffic spike | Access logs: one image file, many requests, foreign referer | Enable Cloudflare Hotlink Protection or add the .htaccess rule, then re-check the logs in 24 hours |
| One foreign domain in the logs | Open the linking page; view source; confirm the image address is your domain | Block that referer in .htaccess or Nginx, or email the site owner and ask them to host their own copy |
| Google Images shows your file on other pages | Open the result and inspect the image address | If the address is yours, block by referer; if it is a copy on their server, use the DMCA route instead |
| Reverse search finds your photo elsewhere | Check whether the image URL is your domain (hotlink) or theirs (copy) | Hotlink: block it. Copy: file a DMCA takedown, see our DMCA takedown guide for stolen photos |
| A single image is being abused right now | Logs show thousands of requests from one referer today | Rename the file and update your own pages, the hotlink breaks immediately while you set up permanent protection |
| Protection is on but your own images broke | Load your site in a private window; check the image URLs | Add your own domain and your CDN subdomain to the allow-list, and allow blank referrers |
How do you turn on Cloudflare Hotlink Protection?
Cloudflare’s Hotlink Protection sits in its Scrape Shield tools and needs no code. According to Cloudflare’s own documentation, it blocks other sites from displaying your images while still letting search engines crawl them. Follow these steps:
- Sign in to Cloudflare and open the domain you want to protect.
- In the left-hand menu, go to Security > Bots (in older accounts this appears under Scrape Shield).
- Find Hotlink Protection and switch it On.
- Load your own site in a private browser window and confirm your images still appear.
- Load the hotlinking page again, or re-run the referer test from the worked example above: a request with a foreign referer should now fail instead of returning the image.
One trade-off to know before you switch it on: Cloudflare notes that Hotlink Protection also stops your images from displaying on sites such as Google Images and Pinterest, because those services fetch your images from an external referer too. If image search traffic matters to you, the .htaccess or Nginx rule below is the better choice, because it lets you allow Google and Bing by name while blocking everyone else.
Cloudflare also lets you allow specific directories if you want some images, a press kit, for example, to stay embeddable. Add those paths to the allow-list rather than switching the whole feature off again.
How do you block hotlinks with .htaccess on Apache or LiteSpeed?
If your site runs on Apache, or on LiteSpeed, which reads Apache-style .htaccess files, this is the most common fix. It checks the referer of every image request and refuses the ones that do not come from your site, from a blank referer, or from a search engine you allow. Back up your .htaccess file before editing it, and test your site immediately afterwards: a typo here can hide your own images.
Open the .htaccess file in your site’s root folder (via your host’s file manager or FTP) and add the following, replacing yourdomain.com with your own domain:
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?yourdomain\.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google\.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?bing\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp|svg)$ - [NC,F,L]Line by line: the first line switches the rewrite engine on. The second allows blank referrers, visitors whose firewall or privacy settings strip the referer, and anyone opening an image directly, still see your pictures. Without it, you would block genuine visitors. The third line allows your own domain. The fourth and fifth allow Google and Bing, so your images keep appearing in image search. The last line refuses all other requests for image files with a 403 Forbidden answer.
If you would rather show hotlinkers a message than a broken image, replace the final - with the address of a warning image you have uploaded, for example https://yourdomain.com/stop-hotlinking.jpg, and change the flags to [NC,R,L]. Every hotlinked image on the offending site then displays your warning instead.
To block one specific domain rather than all outsiders, add a condition naming it:
RewriteCond %{HTTP_REFERER} ^http(s)?://(www\.)?offending-site\.com [NC]
RewriteRule \.(jpg|jpeg|png|gif|webp)$ - [NC,F,L]Use this targeted version when a single site is the problem and you want everything else untouched. If you use a CDN, add your CDN subdomain to the allow-list too, or your own pages will stop loading their images.
How do you block hotlinks on Nginx, in cPanel, or by renaming the file?
Not every site runs Apache. The fix is the same idea, allow your domain and the search engines, refuse the rest, but the place you write it changes. Pick the section that matches your setup.
Nginx
Nginx has no .htaccess file. Add a location block to your server configuration file, replacing yourdomain.com with your own domain, then reload Nginx:
location ~ \.(gif|png|jpeg|jpg|webp|svg)$ {
valid_referers none blocked ~\.google\. ~\.bing\. ~\.yahoo\. yourdomain.com *.yourdomain.com;
if ($invalid_referer) {
return 403;
}
}The none blocked part allows blank referrers, the search-engine patterns allow Google, Bing and Yahoo, and your domain and its subdomains are allowed. Any other referer gets a 403. Test the configuration with nginx -t before reloading: a bad reload can take the whole site down, so never skip that check.
cPanel Hotlink Protection
If your host provides cPanel, you may never need to touch a file. cPanel’s own documentation describes a built-in Hotlink Protection tool that writes the same kind of rules for you. Open Security > Hotlink Protection, add your domain (and any subdomains or partner sites) to the list of allowed referrers, tick the file types to protect, and enable it. You can also choose a redirect address so hotlinkers see a warning image instead of a broken one. This is the easiest option for a site owner with no server experience, but it only exists if your host offers cPanel.
Rename the file and replace it
Renaming is the fastest emergency fix and needs no server access at all. Change the file name, for example from summer-sale-banner.jpg to summer-sale-banner-v2.jpg, upload the renamed file, update every link to it on your own site, and the hotlink breaks instantly because the old address now returns a 404. It stops the bandwidth drain today, but it stops nothing tomorrow: anyone can hotlink the new file name the same way. Treat renaming as a first-aid step while you set up one of the permanent rules above.
Two habits make all of these fixes stronger. First, add a visible watermark to your photos before you publish them, so even a hotlinked image carries your name and address. Second, keep a copy of the protection rules you used: if you move hosts, you will need to re-apply them, and a server move is the most common moment protection silently disappears.
What should you check after you switch protection on?
Protection is not finished until you verify it, because a wrong rule can hide your own images or cut you off from image search. Run this five-point check within an hour of making the change, and again the next day.
- Your own site: open your homepage and three article pages in a private browser window. Every image should load. If any are broken, your own domain is missing from the allow-list.
- The hotlink test: repeat the referer test from the worked example, request an image with a foreign referer. It should now return 403, not 200.
- Direct visits: paste an image address straight into the address bar. It should load, because blank referrers are allowed. If it fails, you blocked blank referrers by mistake.
- Image search: search Google Images for your domain after a few days and confirm your images still appear. If they vanish, Google is not on your allow-list.
- Your logs: check the access logs 24 hours later. Requests from the hotlinking domain should have fallen to near zero, and your bandwidth graph should be back in line with your page views.
If the hotlinker keeps going after the technical fix, for example by downloading your images and re-uploading them as copies, that is no longer hotlinking, and the technical fix cannot help. At that point the route is a takedown request: email the site owner first, then the host, and if the image is your copyrighted work, file a DMCA notice. Our DMCA takedown guide covers the evidence to include. For a wider plan covering watermarks, takedowns and monitoring, see our complete guide to protecting your photos online, and our guide to protecting your photos from being stolen in the first place.
FAQs
Is hotlinking illegal?
Hotlinking is not automatically illegal everywhere, but it often breaks the law: the image is usually someone’s copyrighted work, and displaying it without permission can infringe that copyright. If the image is licensed stock, the hotlinker almost certainly has no licence for it. If a polite email is ignored, a takedown request or DMCA notice is the legal route.
Will blocking hotlinks hurt my Google rankings?
No, not if the rule is written correctly. Search engines must be able to fetch your images to index them, so allow Google and Bing by name and allow blank referrers. With those exceptions in place, blocking hotlinks has no effect on rankings. A careless rule that blocks Google too can remove your images from image search entirely.
Can someone still steal my image after I block hotlinking?
Yes. Hotlink protection only stops other sites from loading the file from your server. Anyone can still right-click and save a copy, screenshot it, or download it and upload it elsewhere. Blocking hotlinks saves your bandwidth; it does not stop copying. Watermarks and takedown requests are the tools for copies, not referer rules.
How do I find out which site is hotlinking my photos?
Check your access logs for image requests whose referer is a domain that is not yours, that domain is the hotlinker. In cPanel this is under Metrics, Visitors or Raw Access Logs; in Cloudflare it is under Analytics. You can also search Google Images for inurl:yourdomain.com minus site:yourdomain.com to find pages embedding your file addresses.







