The Frame Buster
Aren’t framesets annoying?
Sometimes you’ll find somebody insists on loading up your website into their own frame-based layout. This can be problematic for a number of reasons. It messes up your layout; it confuses the user; it makes bookmarking pages in your site problematic; and it can be construed as them passing off your content as their own. In other words, copyright infringement.
At the same time, there are sites where a frame buster script would be undesirable. Perhaps you have three or four different sites of your own, and you want to include one of them in a frameset or an <iframe> for demonstration purposes. Perhaps you have a partner site that you want to allow to frame you in. Perhaps you are linked up with some website or other whose terms and conditions prohibit you from overriding their frame sets with your website. Or perhaps you just want it to work properly with WordPress 2.0’s post preview facility.
Look no further!
This frame buster script will override framesets in every website except your own. You can also specify a list of domain names which are allowed to frame you in if you like.Installation and Configuration
Installation is simple. Unzip the file framebuster.php into your /wp-content/plugins directory and enable it in the “Plugins” section of the WordPress dashboard.
The frame buster’s configuration settings can be found under the “Options” tab in your dashboard. It contains two simple options: a checkbox to turn the frame buster on globally, and a text area which allows you to turn it off on a per-domain basis.
List every domain name on a separate line. They are not case sensitive, so WWW.JAMESMCKAY.NET will match www.jamesmckay.net and so on. If you want to turn the frame buster off for subdomains as well, prefix these with *., so
*.jamesmckay.net
*.framebuster.jammycakes.com
will turn the framebuster off for all subdomains of jamesmckay.net and framebuster.jammycakes.com.
Compatibility
Compatible with WordPress 1.5 and 2.0.
Notes
You need to have this line in the <head> section of your template. Most publicly available templates have it, but if you’ve removed it from yours you need to put it back:
<?php wp_head(); ?>
Licence
This is free software; you may freely distribute it under the terms of the GNU General Public License, version 2.0 or (at your option) any later version.
Blog discussions
- 13 Feb 2006: Initial announcement
- 8 Aug 2006: Version 1.0.2 Bug fix release.
- 28 Dec 2006: Version 1.0.4 Bug fix release.

RSS feed


04:45
Hi,
Seems like a useful plugin. I just installed it to get rid of the netscape frame but it still sticks.
Is this because the plugin doesn’t work here or maybe some other reason?
09:10
A couple of things you can check:
1. Have you enabled it in your WordPress dashboard?
2. Do you have JavaScript enabled?
3. Try clearing your browser cache. If you have a cached version of your website that you loaded directly, it may be using that instead. The plugin examines the referring page when deciding whether or not to include the frame buster Javascript, so a cached copy may not have the Javascript included.
4. It won’t override framesets on the same domain as your blog. This is necessary for compatibility with the post preview facility in WordPress 2.0.
There is a bug in version 1.0 beta 1 of the plugin: it doesn’t work properly if your website specifies a port number, e.g. http://www.jamesmckay.net:8080/. I will post a fix for this in the next few days.
18:50
This is supposed to be a .NET site. The code is all PHP so useless in ASP.Net
06:13
nice plugin.its very useful to us.thank you.1031 exchange
21:52
Thanks for this, works with WordPress 2.1 (so far!)
22:43
Hi
well my ISP will not host ASP pages so i went for framesets as a quick fix so i did not need to replicate code all over the
place so in my case i need to deal with users going direct to the pages so i used
if (top.frames.count==0)
window.location.href=”MyNainFrameset.htm”;
few site test for frames so it’s easy to put a wrapper around them which can be useful
See the homepage at http://www.WebSiteTips for a sample of using Iframes so that text can go in front of Flash.