Stop framing sites from stealing your content

As with any business, it takes work to operate a successful website and producing frequent, quality content can be a time consuming task, especially if you care what you write about. About 2 months ago on another site of mine, I started to find an excessive amount of requests coming from one particular IP so I dug in a bit deeper to get to the bottom of it. The requests led me to find a site that was taking website content and framing it (putting it inside an iframe) on their page, so basically it was my site within a page on their site, with their address in the url and a header at the top with their ads on it.

While this is not a new practice, it was the first time it had happened to me. At first I had mixed feelings on it as it was a source of exposure for me, it got my content to a new group of readers but there was one major downside to this practice that makes it totally unacceptable to me. When search engines traverse the web looking for new content, they find it and index it, during this process they sometimes find duplicate content and will penalize a site for having copied/stolen content on its pages because plagiarism is a bad thing and nobody likes it, well guess what? When a site uses an iframe to post your content with their url in the address bar that creates duplicate content on the web and often times, the site doing the copying may have a higher pagerank or more “street cred” with the search engines therefor getting your site, even though it was your content originally, flagged as the one doing the stealing and in the end getting you penalized and your rankings damaged.

There is a simple fix that will prevent a good portion of this, its basically a small snippet of code that will tell your site to check to make sure its not inside an iframe, and if it is to break free from the iframe and return itself to full page view. It works on every site I have used it on, but of course your mileage may vary so please test it for conflicts etc on your applications as with any code changes.

To add this code to your site, simply paste the following code somewhere after the <head> tag and before the </head> tag of your site, in WordPress this will be in your header.php file

<script language="javascript" type="text/javascript">
if (window!= top) top.location.href = location.href;
</script>

I hope you find this useful and please feel free to share your comments on the topic :-)

21 thoughts on “Stop framing sites from stealing your content”

  1. If your content is coming from the same url as normal (which is the case here as it is framed) you haven’t got anything to worry about in terms of duplicate content. Your content may be displayed on their page but it isn’t actually part of the page containing the iframe. Google is only looking at a page’s source code so the people linking your content gain nothing from just having your stuff in an iframe beyond the advertising clicks they might be stealing from you.

    Also the notion google penalising you for duplicate content is a misunderstanding – you’re not penalised, they simply omit some results if they’re overly similar to avoid showing things like the print version of a page aswell as the regular one so it can seem like you’re being punished when you’re not. http://googlewebmastercentral.blogspot.com/2009/09/duplicate-content-and-multiple-site.html

    Reply
    • You are correct about the iframe and the page source but the thing that made me aware of it happening was their page ranking higher for my content than my own was.. perhaps it was just due to the title being there and their site having more PR than mine did at the time who knows, I do know that since I implemented this fix I have not had it happen again.

      Additionally, as Google progresses towards making googlebot browse and index the web more like a human visitor I expect framed content may follow the same path that javascript content has already.. Times are changing and I prefer to stay ahead of the curve whenever possible.

      As for the penalty for duplicate content, call me wrong if you want but in that scenario one page wins and one page loses, if my page is de-indexed and another stays then it’s no different than a penalty to me, the end result is the same.

      Reply
  2. What does this: Enter WhoYouAre@YourChosenKeywords as your name. mean??

    Anyway, I use code similar to this to stop Google from framing all my images! (of course, they frame everyones. That’s how images are stolen by Google.)

    Reply
    • Hi, thanks for stopping by.. It means that if you had put Donna B@oped cartoons your linked name on your comment would look like “Donna B from oped cartoons”

      using the anchor text that you wanted instead of just making a link out of your name :-)

      Reply
  3. Jesse,

    Where this really becomes an issue is when these lazy webmasters and site owners steal our content and the search engines index our stolen content on their website first. We are penalized for duplicate content when this happens, those who say otherwise have no clue at all on how it all works.

    Reply
  4. Forgot to mention that you should also include this piece of code in your htaccess file

    Header append X-FRAME-OPTIONS “SAMEORIGIN”

    This tells all the browsers that they can not load pages from your site that are located on another website. This really helps.

    Reply
  5. Thanks for this!

    Previously my content was duplicated by FeedReader.com using an Iframe and even got indexed by Google. My site’s traffic is badly affected.

    After pasting this code at my header.php, all the duplicated link are redirected to my site.

    I’m now waiting for the outcome. Thanks again!!!

    Reply

Leave a Comment