Retriev3r
2/1/2018 - 10:03 AM

Disable Hotlinking of Images in WordPress

Another common way to steal images from websites is by loading them from the original source. The image will load from your servers and will be displayed on third party websites without your permission.

This also increases your server load and bandwidth usage.

Here is how you can disable hotlinking of images from your WordPress site.

Simply add this code to the .htaccess file in your WordPress site’s root directory.
	
#disable hotlinking of images with forbidden or custom image option
RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?wpbeginner.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L] 

Don’t forget to replace wpbeginner.com with your own domain name.