Courtesy of: Paddy Moogan

The Ethical SEO team just got back from MozCon in the great city of Seattle, and we are excited to share some of the secrets we learned! In this post we’ll show you how to run a script (written by, Tom Anthony) which will cause embed code to be displayed whenever an image is right clicked. Paddy Moogan of Distilled shared this tip. Here, we’ll explain it so that, hopefully, anyone can implement it on their WordPress site!

Insert this code in your site’s header:

It should look something like this:









Now we need to add reference code to the actual image so that the embed code will be displayed whenever someone right clicks it.

If you have an image inserted in a post, you will see this in your HTML editor:










Enter this code in front of the image code. Now, your code should look like this:

Finally, you’ll need to add this code to your image source code, so it looks like this:









Please drop me a comment below if you are having any issues!

July 31, 2012 | Link Building

Share This Post

  • Ian Lockwood

    Hi Matt, thanks for sharing this. I’ve just tried it and whilst it works, when there are multiple images in the page, it always opens the Embed text box where it first appears in the code, not next to the image that was right-clicked (although the URL in the embed code is correct for the image that was clicked).

    I guess you need to tie each image to a unique instance of the embed code above it, but I’m not sure how to do that – any ideas?

    • Matt Green

      Hi Ian – I actually haven’t tried it with multiple images. My assumption is that you’ll need to insert this code –, in front of each image to have the code box appear above the specific image. I’ll give it a whirl and let you know.

      • Matt Green

        Nope – my assumption was wrong. This may be a question for either Paddy or Tom Anthony, who wrote the script.

        • Kevin

          [reg: multiple images]
          Or try it with jQuery and use selectors as $(this). to only influence the image you click on; not the others.

          I like this nifty little thing, great for infograhics.

          • Matt Green

            Thanks for the tip, Kevin!

  • Jordan

    What’s the purpose of this? This is supposed to help with sharing images through embeds as a method of link building? Anyone try this with any success yet?


    • Matt Green

      That is correct. With the embed code automatically being displayed when the image is right clicked, the idea is that anyone who wants to use the image will be easily given the opportunity to do so using the embed code, which links back to the site where the image originated. Depending on the quality of the image and the amount of views it receives, this can be an effective link building tactic.

  • Marisa

    But all you have to do is click on the image and it opens by itself and then you can save it!

    • Matt Green

      Valid point :). The auto embed code does increase the likelihood that they will choose to embed the image and give you credit.

  • Casey

    But if they use your image you can just do a Google reverse image search and find them. Another link building tip :)

  • Lee

    Hi, is there any way we can modify the image code so that its just an image, rather than linking to itself? This would solve the issue of people clicking the image, opening it on its own then copying it from there.

    I did have a play about with it but the couple of things I tried, didn’t work.

  • Lee

    Also, with Panda/Penguin and issues about more diverse link building, perhaps it would make sense to force the link back to the page the image was taken from? This would drive a lot of deep links back to your site, rather than sending them all to your homepage.


    • Matt Green

      Great point. You can definitely adjust the code with a URL other than the home page. So, instead of a href=”” it would be a href=”

      Regarding modifying the image so that it is not linked to directory where the image is stored, I’d have to defer to someone smarter than me to figure that out :)

      Thanks for commenting!

  • j

    Hi Matt,

    Just wondering what happens if they try to copy an embeded image
    from other place.
    Is it possible and if so who gets the link ?



    • Matt Green

      I think what you are saying is, what happens when a person embeds your image on site A, then someone else copies the image from site A onto site B. What would the image on site B then link to?

      If this is what you mean, the answer is that, at this point the image may link to nothing. But, you could use Paddy’s Embed code inside embed code to get around that.

  • Ramesh Nair

    Looks like a cool way to build link. Can one also include a keyword text along with the image – like how infographics get shared with a backlink?

  • Matt Green

    Ramesh – yep. You just have to update your a href code to include anchor text. Be careful though – if a particular image attracts a bunch of links, you could end up with a Penguin-unfriendly link profile.

  • Athul

    thanks for the use full tips

  • Mario In

    Ottima soluzione…