This morning I discovered that another website was loading one of my websites inside a frame. This means that my website was showing up inside theirs in a way that attempts to make it look like my website is a part of that website. It looked like this.
They were using my website as a “resource” for their own visitors. My first thoughts were that I really didn’t like that.
Yes, in a way it is a compliment that they considered my content good enough to use as a resource.
However, I would have much preferred an ordinary link that allows my website to be displayed as I had intended. I did not recall agreeing with the site owner for my site to be used in that way.
Furthermore, I was not sure how this would affect other aspects of my site, e.g. the Google advertisements that appear on the site. The bottomline is that I decided that I did not want my site to load in this way.
Initially I considered contacting the website owner to get them to change it. Then it dawned upon me that there might be other sites that are loading my content in this way. I did not want to go on a hunting expedition to track them down and contact them individually. So I decided that “frame busting” code was the way to.
Frame Busting Code
Here is the script that I used:
I added this code inside the header (between the <head></head> tags) on every page on my site.
That’s all there was to it, and it works like a charm!
If somebody is loading your website inside their website and you don’t like it, I hope this article helps you to solve the problem and prevent it from happening again.