How to stop your images from being pinned to Pinterest

Pinterest screenshot

Pinterest is an interesting tool, and a lot of people I know love it.

This is how it works. You maintain a set of pinboards for different kinds of images – for example, I’ve got pinboards for logos, app wireframes, and interesting visuals. If you visit a site that has an image you’d like to keep, or share, you click a “pin it” button in your browser, and that image is copied to one of your pinboards.

Obviously, not everyone loves this. It arguably pushes the envelope of fair use, and will probably torch it completely once the owners attempt to monetize. Although images are linked to their origin pages, the attribution isn’t visually striking, and it’s not like the web is actually shared under an attribution license. I’m not a lawyer, but some people might see it as copyright theft.

To answer this, Pinterest have created a meta tag that you can stick at the top of your site: meta name=”pinterest” content=”nopin”. If it’s present on the parent page, Pinterest will refuse to copy your images (although I presume you can get around that by loading an individual image in the browser). Hackers are, rightly, protesting that this sets an unmanageable precedent: imagine having to individually opt out of having your content copied by thousands of different applications by having to stick thousands of different meta tags at the top of every page. It’s dramatically unscalable.

Pinning is not a million miles away from Tumblr‘s reblogging, and it seems reasonable that there should be a meta name=”republish” content=”no” meta tag that covers all of these services.

Until then, here’s some dubious fun you could have at your own risk (if you don’t want to include the meta tag). This was pretty common about ten years ago, when hotlinking images could cause major bandwidth bills for the owner.

  • Currently, the HTTP user agent for the bot that actually copies images for Pinterest is Pinterest/0.1 +http://pinterest.com/.
  • The JavaScript bookmarklet works through your browser, of course, but it sets the HTTP referer for the page to a URL starting with http://pinterest.com/pin/create/bookmarklet/.

I’d detect Pinterest based on user agent, not referer – there are many situations where referer could be stripped out. This is true for user agent too – this isn’t guaranteed to work 100% of the time, and depends on your server setup – but there are only two parties to worry about in this scenario: your server, and Pinterest’s. (If you’re filtering the bookmarklet, you also have to worry about configuration changes in the user’s browser.)

All you need to do is filter requests by user agent in your web server’s graphics folder. If you’re running Apache with mod_rewrite, you could create an .htaccess file in your graphics folder with rules like:

RewriteCond %{HTTP_USER_AGENT} ^Pinterest.*
RewriteRule .*\.png$ copyright.png

The above rewrites any requests for PNG files to copyright.png. The contents of that graphic will be pinned to Pinterest instead of the intended image.

(PS: want to try it out? Try pinning the image illustrating this blog post.)


Posted

in

by

Comments

9 responses to “How to stop your images from being pinned to Pinterest”

  1. Marcus Povey Avatar

    Why do I have a feeling that this will lead to a resurgence in the appearance of Goatse…

  2. Brandon Avatar
    Brandon

    I see what you did there, googled “unscalable” to make sure it was a real word… At least now I know im not the only one…

  3. Nicole Avatar
    Nicole

    Thanks Ben!
    And your replacement graphic made me laugh out loud…;)

  4. Brooks Avatar
    Brooks

    Ben,
    Try as I might, I could not get this mod rewrite to work with Pinterest. It appears to be doing the 302 substitution, but Pinterest just hangs at the Create Pin dialog and never completes.
    Any ideas?

  5. Ben Werdmuller Avatar
    Ben Werdmuller

    Brooks – another way to test is to write a PHP script that outputs your images. This might contain something like:

        header('Content-type: image/png');
    
        if (substr_count($_SERVER['HTTP_USER_AGENT'],'Pinterest'))
            echo file_get_contents('pinterest.png');
        else
            echo file_get_contents('substitute.png');
    

    You’d probably want to establish cacheing, etc.

  6. Brooks Avatar
    Brooks

    Ben,

    Thanks again! Yes, I thought about this approach, but the .htacess would be so much nicer for rolling out to several existing sites, rather than trying to insert any PHP image management solution – I suppose a combination would also work (rediirect all image requests to PHP image delivery), but I would still rather use the straight forward redir.
    Just thought you might have run across this error (hang on delivery) and have a tip.
    There’s nothing weird like the image dimensions have to match between the requested and delivered image or something like that?
    Thanks again. This is still a great solution… even if I can’t get it to work 🙂

  7. salidatious Avatar

    Thank you! Not that I have anything worth pinning but it’s nice to know there’s a blog I regularly read that covers this! Sal x

  8. PJ Avatar

    My site is image based and I have all of the good stuff, barring tiny thumbs and cropped banners locked in Flash albums. Works for me!

  9. Jared Henderson Avatar
    Jared Henderson

    why make an invalid attribute? couldn’t you have used data-nopin=”nopin” so we can still have valid HTML? This seems like a no brainer to me

Leave a Reply

Your email address will not be published. Required fields are marked *