To illustrate a page, the easiest shortcut is to paste the URL of an image found elsewhere: <img src="https://your-site.com/wp-content/uploads/photo.jpg">. The image shows up on the other site, but it's your server that sends it, to every one of its visitors. The Apache documentation describes the practice as using your bandwidth to serve content on someone else's site.
How hotlinking works
When a browser loads an image, it usually states the page containing it in the Referer HTTP header. MDN explains that this header may contain the origin, path and query string of the page, depending on the referrer policy in effect. That's what makes it possible to recognize requests coming from other sites.

Why it matters
- Bandwidth and server load: a photo reused on a high-traffic page multiplies the requests to your hosting, which hurts on a capped plan or one billed by traffic.
- Use of your visuals: your work illustrates someone else's site, often without permission or a link back to you.
- Reputation risk: your file can appear on a shady site, and any change on your end shows up there too.
How to prevent it
Protection relies on the Referer header, with two limitations the Apache and Nginx docs point out: it's optional, so some browsers or privacy settings don't send it, and it's easy to fake. So you have to let requests without a Referer through, and treat this protection as a brake on everyday hotlinking, not as a security measure.
On Apache, in an .htaccess file, the documentation offers a simple rule:
SetEnvIf Referer example\.com localreferer
<FilesMatch "\.(jpg|png|gif)$">
Require env localreferer
</FilesMatch>
As written, this rule also rejects requests without a Referer; the mod_rewrite variant on the same page lets them through and can serve a replacement image. On Nginx, in the server block, the referer module does the sorting:
location ~* \.(jpe?g|png|gif|webp|avif)$ {
valid_referers none blocked server_names *.example.com;
if ($invalid_referer) { return 403; }
}
Behind a CDN, images served from its cache never reach your server: protection has to be turned on in the CDN itself, such as Cloudflare's Hotlink Protection.
For WordPress
Blocking blindly can make your images vanish from Google Images or from link previews on social networks, which bring you visitors. Start by observing. WP Feint Pro offers image hotlink detection for this: in Detect mode, it lists the sites displaying your images, with the number of requests and the estimated bandwidth, without blocking anything; in Protect mode, it returns a “Protected image” picture, a transparent pixel or a 403 error, while always letting through your own site, requests without a Referer, search engines and social networks. It writes its rules to .htaccess on Apache and LiteSpeed, and provides the block to copy on Nginx. Like any protection of this kind, it doesn't see images served by a CDN, or copies of images hosted elsewhere.
The effects on image SEO are covered in our article on masking and its real effects on SEO.