How to use .htaccess for preventing Image Hotlinking in WordPress?

How to use .htaccess for preventing Image Hotlinking in WordPress?

Many WordPress users find managing their websites a very difficult task. Image hotlinking is nothing but image theft that also impacts the web hosting server. You may have heard of utilising DMCA to safeguard the material on your website. Unfortunately, this does not prevent anyone from connecting to your website with images.

Someone links your photos to you when they copy your images together with their original URL. If you don't take the necessary precautions, it might turn into something strange.

You will notice server overuse and slow website loading times after a few months. In this case, you'll need to increase your web hosting package to acquire extra server disc space.

You'll learn how to use the. htaccess file to block image hotlinking in this article.

Stop image hotlinking by using the code editing method:

You might be thinking if you can do it using a cPanel built-in feature. You certainly can, but you must first understand all of the ways. Also, you might be thinking about how you can change the.htaccess file if you don't have cPanel access. You may be aware that the Yoast SEO plugin allows you to modify the robots.txt and .htaccess files directly from the WordPress admin panel.

However, in this lesson, you'll be using cPanel.

Let's get it started!

Step 1:
Firstly, log into your cPanel account and look under the Files area for the file manager icon. It's one of the most popular directories since it contains all of your website's information.

Step 2: Some businesses keep their website installations in the "www" folder, while others keep them in a separate location. If your server just hosts one website, the data is more likely to be found under the public_html/root directory.

You'll need to look for the .htaccess file.

Step 3: You may add code to the.htaccess file by right-clicking>>editing it, or by using the Edit option on the horizontal navigation menu. To confirm, a window displays on your screen.

Step 4: Before the #End WordPress comment, paste the code.

Hence, these are all the steps that need to be followed.

By resolving any problem with a WordPress website, users may look for a plugin. You may use All In One WP Security & Firewall to prevent image hotlinking; it's one of the most popular security plugins with a lot of capabilities.

If you don't want to mess with the.htaccess file, you may just use a plugin.

The built-in function in cPanel allows you to simply stop picture hotlinking, however, it does not provide you complete control. Using the.htaccess file, you may restrict access to your website's images. As you can see in the code, you may provide access to the website you choose.
Author
kumkumsharma
Views
228
First release
Last update
Rating
0.00 star(s) 0 ratings

More resources from kumkumsharma

Top