Title: Prevent Hotlinking
Last modified: February 15, 2018

---

# Prevent Hotlinking

 *  Resolved [dberdal](https://wordpress.org/support/users/dberdal/)
 * (@dberdal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/)
 * I’m a brand new users, so maybe I’m just misunderstanding how it works.
    I have
   the setting checked “Prevent Hotlinking”.
 * However, the plugin is still allowing the file to be downloaded directly
 * [https://new.essentialoilylife.com/download/19930/](https://new.essentialoilylife.com/download/19930/)
 * Here’s how I was hoping it would work:
    - Setup Password protected page: [https://new.essentialoilylife.com/password-protected-doc-download/](https://new.essentialoilylife.com/password-protected-doc-download/)
    - On that page have a Download available
    - prevent users from sharing the download link directly

Viewing 5 replies - 1 through 5 (of 5 total)

 *  Thread Starter [dberdal](https://wordpress.org/support/users/dberdal/)
 * (@dberdal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9979179)
 * P.S. I guess it’s working in the sense that the link above does redirect to my
   homepage… but if you copy/paste the link into your browser you can still download
   the file.
 * I was hoping that it would only be downloadable if linked on my site.
 *  Plugin Contributor [Barry Kooij](https://wordpress.org/support/users/barrykooij/)
 * (@barrykooij)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9981184)
 * Hey there,
 * The ‘hotlink protection’ feature by default only blocks if another website is
   linking to your download. If a user enters the URL in the browser there is no
   referrer at all (so not hot linked), this is why this works by default.
 * However, this behavior can be changed. Add the following code to your theme’s
   functions.php to also block empty referer:
 *     ```
       add_filter( 'dlm_hotlink_block_empty_referer', '__return_true' );
       ```
   
 * Kind Regards,
 * Barry Kooij
    -  This reply was modified 8 years, 4 months ago by [Barry Kooij](https://wordpress.org/support/users/barrykooij/).
 *  [kjm44](https://wordpress.org/support/users/kjm44/)
 * (@kjm44)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9988956)
 * I’ve just put that code in my functions.php file and it is not working. I am 
   still able to download a pdf if I cut and paste the link directly into a browser.
   I have the download set up properly and the download link is blocked successfully,
   but not the attached PDF file.
 * e.g. [https://website/download/6474/](https://website/download/6474/) is blocked
   but the link to the PDF is not.
 * This important, please help.
    -  This reply was modified 8 years, 4 months ago by [kjm44](https://wordpress.org/support/users/kjm44/).
 *  [kjm44](https://wordpress.org/support/users/kjm44/)
 * (@kjm44)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9988999)
 * My apologies, I have worked out what I was doing wrong and it is all working 
   perfectly now.
 * Great plugin! Thank you.
 *  Thread Starter [dberdal](https://wordpress.org/support/users/dberdal/)
 * (@dberdal)
 * [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9989854)
 * Worked as expected, thanks a lot! I think a decent number of people would use
   this feature if it was added to the UI.

Viewing 5 replies - 1 through 5 (of 5 total)

The topic ‘Prevent Hotlinking’ is closed to new replies.

 * ![](https://ps.w.org/download-monitor/assets/icon-256x256.png?rev=3198936)
 * [Download Monitor](https://wordpress.org/plugins/download-monitor/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/download-monitor/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/download-monitor/)
 * [Active Topics](https://wordpress.org/support/plugin/download-monitor/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/download-monitor/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/download-monitor/reviews/)

 * 5 replies
 * 3 participants
 * Last reply from: [dberdal](https://wordpress.org/support/users/dberdal/)
 * Last activity: [8 years, 4 months ago](https://wordpress.org/support/topic/prevent-hotlinking-2/#post-9989854)
 * Status: resolved