How To Disable Hotlinking & Content Leeching in WordPress?

Hotlinking could result in increase of bandwidth usage & it will also result in server load or outages, to prevent hotlinking & content leeching in wordpress there are two methods .htaccess method & plugin method.

Hotlinking & Content Leeching Protection Using .htaccess :

Put following code inside .htaccess file of your wordpress manually (on server) or you can use .htaccess editor plugin.

Code :

RewriteEngine on
RewriteCond %{HTTP_REFERER} !^$
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?sparringmind.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?google.com [NC]
RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)?feeds2.feedburner.com/devilhax [NC]
RewriteRule \.(jpg|jpeg|png|gif)$ – [NC,F,L]

edit above code and replace devilhax with your own feed otherwise your feed images won’t be displayed correctly.

Hotlinking & Content Leeching Protection Using Plugins :

Leave a Reply