How to Prevent Image Hotlinking for Your WordPress Sites

How to Prevent Image Hotlinking for Your WordPress Sites

The issue of image hotlinking can be irritated for all the WordPress users. Once this happens, your bandwidth consumption will exceed the general limit and your page loading speed can be far slower than before. To be frank, resolving this problem can be complicated as you need to figure out which images on your site are hotlinked. In this case, we’d like to list some precaution methods about how to prevent image hotlinking for your WordPress sites.

General Information about Hotlinking

Before presenting the detailed tips, we firstly want to introduce something about this issue. In fact, image hotlinking is an online behavior of directly linking a file from your website. To put it in a vivid manner, if there are some other webmasters who steal your images, videos or files and showcase these items on their sites using your file links, you are encountering the image hotlinking issue.

The detailed information about this issue can be found in this post. You only need to know that blocking image hotlinking can prevent the thefts from stealing your server bandwidth and creative graphical components.

How to Prevent Image Hotlinking

As for the prevention methods, we have listed 4 options in total, including image watermark, plugin utilization, .htaccess configurations and the activation of Hotlink Protection service offered by your web hosts.

Method 1 – Add the Watermark for Your Graphical Components

This is the easiest way for the prevention of image hotlinking, with which you do not need to make any back-end changes and configurations on your WordPress site.

To carry out it, you only need to embed all your images with the unique watermark that is exclusively for your site. Here, we highly recommend the utilization of WaterMarkTool, with which you can protect your images easily and effectively with a visible symbol.

To use, you firstly need to upload your images to this platform. Here, you can upload and modify multiple options in on time. After that, you need to personalize your images just like the following screenshot showcases.

WaterMarkTool

Here, you can decide the textual content, font, text size, position, color and transparency of the watermark based on your preference. Personally, we recommend you to use your website name as the text and place it at the middle center location with no more than 50% transparency. This can showcase the ownership of the images greatly without affecting the overall image display.

In addition, to maximize the effects, you’d better apply the same watermark to all of your images.

Method 2 – Make Use of the WordPress Plugin

If you do not want to use the watermark to devalue your graphical components, you can make use of a useful WordPress plugin to block the practice of image hotlinking.

Here, we highly recommend the ByREV WP-PICShield plugin. After installing on your WordPress admin and activating it successfully, you can find the “WP-PICShield(ByREV)” button from the Settings tab of the administrative panel. Click it to enter the settings page of this plugin.

Basic Settings

First of all, you need to enable the hotlink protection as the plugin function is not activated by default. As for the GTFO key, cache folder and hotlink image opacity, you can leave their settings unchanged if you do not have any special requirements.

Basic Settings

Watermark Settings

This is a highlighting feature of this plugin. After enabling the function, the plugin automatically adds a watermark on your uploaded images. What you need to do is to decide the watermark opacity and position. In addition, you can choose to add the time, host name and QR BarCode on the watermark as you want.

Watermark Settings

.htaccess Settings

For this aspect, you can decide the types of files that need to be protected from hotlinking, such as JPG, PNG, GIF and JPEG. As for the “Allowed Domains”, you need to enter your own domain or some others that you allow to use your images. In addition, you also need to enter the user agents that are allowed to access your images. By default, this option includes all the main search engines and you can add additional agents based on your needs.

Here, we highly recommend you to turn on the option of “Allow Social Sites”, for this is beneficial for your social networking marketing.

.htaccess Settings

The rest settings can all be left by default. Then, you can click the Update Options button and this plugin will protect your images automatically.

Method 3 – Use .htaccess File

If you are comfortable in editing your .htaccess file, you can add the following code into this special file for the prevention of image hotlinking issue.

.htaccess Code for Image Hotlinking

As for the coding stuff, the third line should include your domain name and the fourth line needs to have the file types that you want to protect. As for the page link added at the end of this coding, it will be showcased when your hotlinked images are viewed from the sites of image thefts. If you fail to add such a kind of URL, these lines of code will generate a 403 error page instead.

Method 4 – Enable the Hotlink Protection Service Offered by Your Web Hosts

There are so many web hosts that offer the HotLink Protection service for free. If your web host is among them, you can avoid this issue with much ease.

To enable this function, you only need to enter your control panel and click the HotLink Protection Icon. After that, you will be required to enter the domains that are allowed to use your images and the file types that need to be separated using the comma. After that, you simply need to click the Submit button and your web host will handle all the rest things.

Here, we’d like to recommend the best WordPress hosting providers that include this useful feature into their packages, with which you can have your images protected effectively without taking too many times and energies.