How to Enable Hotlink Protection and Leech Protection in cPanel

60 views
Short answer: Navigate to cPanel Hotlink Protection, define permitted referring domains and protected image extensions, and enable protection to stop bandwidth theft.

Prevent other websites from stealing your bandwidth by embedding your images and protect password-restricted directories from credential sharing.

Before you start: Back up your site files and database and download the backup to your own computer. How to take a full backup

Quick reference

Hotlink Tool cPanel > Security > Hotlink Protection
Leech Protection Tool cPanel > Security > Leech Protection
Protected Extensions jpg, jpeg, gif, png, bmp, webp, mp4

Steps

  1. Open Hotlink Protection: In cPanel, click Hotlink Protection under Security.
  2. Configure URLs to Allow Access: Ensure all variations of your domain are listed (e.g. https://yourdomain.com and https://www.yourdomain.com).
  3. Specify File Extensions: Ensure jpg, jpeg, gif, png, bmp, webp, mp4 are included in the extensions list.
  4. Direct Requests Option: Check Allow direct requests so users can open image URLs in a new browser tab.
  5. Enable: Click Submit. cPanel automatically generates the security rules inside .htaccess.

Troubleshooting and tips

  • Broken Images on Social Media (Facebook/Twitter Previews): Add social media crawler referrers or exempt your social share preview folders if thumbnails fail to render when sharing links.
Need more help? If you run into an error while following these steps, open a ticket with technical support and our team will look into it. Open a ticket
Was this article helpful?
No, I need more help
Didn't find your answer?
Under 3 minutes
Submit Support Ticket