Optimizing Frames Tutorial

Article Posted 2002 November 30, Saturday - Page 1 | 2
by Dale Goetsch - Search Innovation | Petaluma, California | United States

Background

Because of the way framed web pages are created, search engine robots have a difficult time spidering sites built in frames. As a general rule, search engine robots are not very good at executing client side code, and framed pages are "built" on the client side. The best way to make a website accessible to the robots is to take it out of frames, but what can be done if the site absolutely must remain in frames?


How Frames Are Built

Typically the "framing" page - the page that includes the <frameset> tags - does not contain any links to the rest of the website; rather, it contains only information necessary for the browser to construct the framed pages.

Figure 1 - index.htm: the "framing" page

<html>
<head>
<title>SuperWidget XYZ from XYZ</title>
</head>
<frameset cols="30%,70%">
<frame src="navbar.htm" frame="left">
<frame src="page1.htm" frame="right">
</frameset>
</html>

The framing page loads the files named in the <frame> tags into the frames defined in the framing page. In our example, they look like this:

Figure 2 - navbar.htm

<html>
<head>
<title>Navbar</title>
</head>
<body>
<a href="page1.htm" frame="right">Page 1</a>
<a href="page2.htm" frame="right">Page 2</a>
<a href="page3.htm" frame="right">Page 3</a>
</body>
</html>

Figure 3 - page1.htm

<html>
<head>
<title>Page 1</title>
</head>
<body>
Welcome to XYZ, home of the new and improved SuperWidget XYZ. We have the best widgets available anywhere today, and at half the price of most leading widgets!
</body>
</html>


What if you can't do frames?

Unfortunately, most robots cannot navigate through this page. They do not understand the <frame> tags, and are unable to move through this page to the pages "navbar.htm" or "page1.htm". Without being able to move through here, there is literally nothing of interest for the robot to index, so there will really be no information in a search engine listing, if the site is listed at all.

The <noframes> Section

One of the tricks that was incorporated into HTML with the advent of frames was the recognition that a page may be accessed by older browsers that are incapable of rendering framed pages: they literally cannot understand the <frameset> tag. This is why there also exists the <noframes> tag. This then allows users on browsers that are not frames enabled to at least see something on a website. Typically, the <noframes> section is wasted on a message telling the user to get a newer browser, thus:

Figure 4 - index.htm with added <noframes> section

<html>
<head>
<title>SuperWidget XYZ from XYZ</title>
</head>
<frameset cols="30%,70%">
<frame src="navbar.htm" frame="left">
<frame src="page1.htm" frame="right">
</frameset>
<noframes>
This web site must be viewed using a frames capable web browser. Your web browser, however, is not capable of displaying frames.
</noframes>
</html>

This page now has information that the robot can spider and include in the search engine database. Unfortunately, you will now be known as the website with the content:

Figure 5 - search engine listing with poor <noframes> text

This web site must be viewed using a frames capable web browser. Your web browser, however, is not capable of displaying frames.

Text in <noframes> Section

This is probably not what you want your potential visitors to see when they look in the search engine listings. Since the robot can spider at least this page, it only makes sense to put your best foot forward and put some real content into the <noframes> section. That way, your search engine listing will actually tell something about your site, rather than just annoy people because they choose to use a browser that doesn't do frames.

Figure 6 - index.htm with better <noframes> text

<html>
<head>
<title>SuperWidget XYZ from XYZ</title>
</head>
<frameset cols="30%,70%">
<frame src="navbar.htm" frame="left">
<frame src="page1.htm" frame="right">
</frameset>
<noframes>
Welcome to XYZ, home of the new and improved SuperWidget XYZ. We have the best widgets available anywhere today, and at half the price of most leading widgets!
</noframes>
</html>

This is a dramatic improvement, because we now have real content on the page that the robot can read and include in the search engine database. You have now upgraded your search engine listing to this:

Figure 7 - search engine listing with better <noframes> text

Welcome to XYZ, home of the new and improved SuperWidget XYZ. We have the best widgets available anywhere today, and at half the price of most leading widgets!

Unfortunately, this is still not enough.

Navigation in <noframes> Section

Most websites comprise multiple pages. Even though you may have a lot of navigation links in your navbar.htm file, the robot will never see it. That means that if you want the robot to crawl the rest of your site, you will need to give it some links in the <noframes> section of the page. To duplicate the navbar functionality, you will need to add those links to the <noframes> text, like this:

Figure 8 - index.htm with added hyperlinks

<html>
<head>
<title>SuperWidget XYZ from XYZ</title>
</head>
<frameset cols="30%,70%">
<frame src="navbar.htm" frame="left">
<frame src="page1.htm" frame="right">
</frameset>
<noframes>
Welcome to XYZ, home of the new and improved SuperWidget XYZ. We have the best widgets available anywhere today, and at half the price of most leading widgets!

<a href="page1.htm" frame="right">Page 1</a>
<a href="page2.htm" frame="right">Page 2</a>
<a href="page3.htm" frame="right">Page 3</a>

</noframes>
</html>

Now you have the best of both worlds: you have text that the robot can grab, and you also have links that the robot can follow to access the rest of your site. As long as you have links to all of the pages on your website that you want the robot to access, you are home free now, search engine wise. The robot follows the link to the file "page2.htm", for example, and indexes the text on that page. How useful this newly indexed content is to your visitor is now up to you.


Why Are Sites Framed?

Read part two of this article which contains the javascript reload solution.

Dale Goetsch - Visit the Search Innovation Consultants Profile
©Copyright 2002 Search Innovation. All Rights Reserved.

< Back to Member Submitted SEO/SEM Articles


Article Disclaimer: The SEO Consultants Directory does not endorse the opinions and/or facts expressed by members who provide marketing articles for our site. These search engine optimization and search engine marketing articles are here for you to review and make your own decisions.


Last modified: 2008-09-25T07:25:46-0700

SEO Consultants Directory