How to Enable Hotlink Protection in cPanel
Are other websites stealing your images or videos by linking to them directly? That’s called hotlinking, and it can slow down your site and increase bandwidth usage.
Thankfully, cPanel has a built-in Hotlink Protection tool that prevents this with just a few clicks.
In this guide, you’ll learn how to enable Hotlink Protection in cPanel, what it does, and how to configure it properly.
✅ What Is Hotlinking?
Hotlinking happens when another website displays your images or media by linking directly to your server. Instead of hosting the file themselves, they use your bandwidth to serve the content.
Example:
htmlCopyEdit<img src="https://yourdomain.com/images/photo.jpg">
If hundreds of websites hotlink your images, it can:
- Increase your bandwidth usage
- Slow down your site
- Cost you extra in hosting fees
- Affect your website’s performance
🚀 How to Enable Hotlink Protection in cPanel
Step 1: Log in to cPanel
Access your hosting control panel via yourdomain.com:2083
.
Step 2: Find Hotlink Protection
Scroll to the Security section and click Hotlink Protection.
Step 3: Enable Hotlink Protection
- Click Enable at the top of the screen.
- Your domain(s) will be automatically added to the allowed referrers list.
- Add any other domains or subdomains you want to allow (e.g.,
cdn.yourdomain.com
or a partner site).
🧾 Optional Settings
1. Block Specific File Types
You can restrict access to certain file types like:
CopyEditjpg, jpeg, gif, png, bmp, webp, svg, mp4, pdf
Only users from your allowed domains can load these files.
2. Redirect Blocked Requests
You can redirect users who try to hotlink your files to a custom URL or image (e.g., a “No Hotlinking Allowed” image or your homepage).
3. Disable Direct Access
If you want to prevent direct access to file URLs (e.g., someone pastes the file URL in a browser), check this option.
🔍 How to Test if Hotlink Protection is Working
After enabling:
- Visit your site and ensure images still load normally.
- Try embedding your image from another domain or use a test HTML file elsewhere — it should block the image.
- Use developer tools to inspect the referrer behavior or check server logs.
⚠️ Things to Keep in Mind
- Don’t block access to file types your own site needs.
- Be careful with CDN URLs — add them to the allowed list if you use a content delivery network.
- If legitimate services (like Google or Facebook previews) need access, you may need to whitelist their referrers.
📌 Final Thoughts
Hotlink Protection in cPanel is a fast and effective way to safeguard your content and bandwidth. It ensures that your hosting resources are used only for your website and not for unauthorized third-party embedding.
Need help setting it up or troubleshooting blocked content? Reach out to our support team — we’re here to help.