Support » Fixing WordPress » Blocking access to direct link to images.

  • So I’m using wordpress as a photography portfolio website, and I am wondering if there is a way, if you right click on an image and “open in new tab/window” it will bring you directly to that photo url..

    Like, my website has lightroom or w.e it is to show photos when you click on the thumbnail it opens up into a bigger photo. However over the image it will display the direct url so like “” and you can go TO that image and save it..I am wondering if there is away to block access to it, or if you go to the folder it redirects you..

Viewing 15 replies - 1 through 15 (of 19 total)
  • Anyone? Maybe what I was trying to say wasn’t clear..

    Let me try it again.

    To put it short and simple, if you hover over an image it shows the direct URL to that image, and if you middle click it, it will bring you directly to that image and you can download it right off my server. I’ve tried everything possible and nothing works, I’ve googled and couldn’t find anything (maybe I’m looking for the wrong thing).

    I included a image so i can better explain what i’m looking to do i guess.. <–Image 🙂

    So you see the URL on the bottom, i put my mouse over the picture of the valley next to that girls face, and each picture i put my mouse over it’ll show the direct URL of that image. If you right click (currently disabled it) or middle click it’ll open up that URL in a new tab. I’m wondering if there is a plugin, code, file or something to add in that will block that little blurb or prevent the images from opening up with the middle click.

    Or being able to look at that URL when hovered over and being able to type it in directly.

    Or maybe if possible, you middle click on the file, or directly go to that URL it’ll make download like a blank html file, or just redirect you to something else.

    However, the images on the website its self MUST open up in the light box, and remain to be seen on my website. I want the functions of being able to click on the image and it opens up bigger in the website its self.

    Would you like to prevent somebody to “hotlink” your images . If yes , this can be done by configuring the .htaccess file .
    Disabling righ clicking on images can be done through javascript .
    Copy /paste this javascript code into your footer template .

    Not hotlinking, unless thats what its really called.

    I’m not worried about someone taking an Image and post it on their website or forum,

    I want to block the direct access to the uploads folder?

    I don’t want anyone to be able to type in and be able to access the image they type in, and to right click -> save image as. If that makes sense?

    Right click is disabled, that’s not the problem.

    if you go to one of my pages ( hover over an image, you can see the direct URL (bottom left firefox 4)and if you type the exact URL you can download the file. I wanna some how either block that URL from showing up, or if you type it in, it will redirect you somewhere.

    A lightbox plug-in may solve it . Tray “lightbox-gallery” , “Simple-lightbox” or “Easy FancyBox”

    The template already has “prettyPhoto” installed..Unless there are better ones with more options? I’ll look into those ones, but knowing my luck i wont have any luck hah

    Or prevent “hotlinking” with .htaccess file (every request to an image-link will redirected to a predefined page ) .

    RewriteEngine on
    RewriteCond %{HTTP_REFERER} !^$
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
    RewriteCond %{HTTP_REFERER} !^http(s)?://(www\.)? [NC]
    RewriteRule \.(jpg|jpeg|png|gif)$ http://page-to-redirect [NC,R,L]

    Where yourdomain/yourdomain2/yourdomain3 are the domains that are allowed to hotlink images ( you can add more domains )

    Hmm i’ll have to try that.

    So for example: = url for image 1? = url for image 2

    and where do i put this .htaccess? In the root folder? or a different one?

    so the .htaccess code’ll redirect, but no images will show up. All are red x’s

    You could disable right clicking, etc. with javascript, but if they really want the picture they can view source or view information via the browser to retrieve it. Basically, anything that the browser sees can be retrieved. You can make it harder to retrieve them and/or use watermarks on your images.

    Check out this link for other ways:

    So pretty much what i wanna do is impossible? I figured as much, my only question is how does Flickr do it? Im assuming since its all written on different source code that’s how?

    Bleh, I was trying avoid watermarks, and low res images..I guess thats the only thing i could do.

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    There’s no way to keep people from hitting up your images by the full URL if they have it. That’s just a fact of life. AND even if you do, someone can screen scrap the image, so the only real protection is (a) don’t put it online and (b) watermark.

    Yeah i figure..However, i just wonder how Smug-mug makes it rollover a clickable image, and it doesn’t list the direct url. I’m assuming its cause of a different code source then wordpress is? But couldn’t something be implemented to ‘protect’ the uploads folder?

    Moderator Ipstenu (Mika Epstein)


    🏳️‍🌈 Halfelf Rogue & Plugin Review Team Rep

    They’re generating the image via flash, I believe, but …

    You can get the direct images there on a lot of images, just by right clicking on them or viewing source.

    I figured as much, my only question is how does Flickr do it? Im assuming since its all written on different source code that’s how?

    I’m not sure how Flickr does it, but you can retrieve their images by viewing page info, selecting media and browsing through the images. Then just select Save As. They can try and keep the inexperienced users from getting the image, but most users know that anything the browser sees, they can retrieve. (Example for Flickr using Firefox. Right click the image. Select View Image Info. A a window will appear where you can select the image and Save As…)

    You could disable right click, but you may end up irritating some of your users.

    But couldn’t something be implemented to ‘protect’ the uploads folder?

    You can protect you uploads folder, but again you have to make sure the browser can retrieve the image. So anything the browser sees, so can the user retrieve. You can make it difficult to retrieve, but it’s still retrievable.

Viewing 15 replies - 1 through 15 (of 19 total)
  • The topic ‘Blocking access to direct link to images.’ is closed to new replies.