Put Your Web Pages on a Diet

May 15, 2008 on 12:00 am | In SEO Best Practices | No Comments

Experienced SEOs know that you can boost your rankings by moving your page content as close to the start of your HTML code as possible. Search engines consider words near the start of your HTML code to be more prominent, and therefore more important, than words buried deep inside the file.

Unfortunately, many web pages are hurt by using layout templates that downgrade the prominence of the page’s primary content. Elaborate HTML tables used to create the page’s masthead and left navigation areas end up pushing the page’s content section - and therefore its keywords - far down in the file.

Just as seriously, web designers clutter the HEAD section of their documents with large sections of JavaScript code or embedded Cascading Style Sheets. While this code can be useful, it pushes your keywords even farther down in the HTML file.

Restructuring your layout tables to improve keyword prominence can be a real challenge and may force you to make design compromises. Fortunately, our New Year’s resolution involves something that’s much easier to address: those bloated JavaScript and Cascading Style Sheets.

That’s good, because for many web pages these are the fattest components. I’ve seen HTML files that were 100 kilobytes in size, yet fully 60k of this was JavaScript code.

The prospect of changing your JavaScript code intimidates many people. If you’re like most webmasters, you don’t write your own JavaScript, but instead use a third-party script or script inserted by your HTML editor.

However, to slim down our pages we won’t actually change the content of our JavaScript. We will lift it intact and place it in an external file. Just be aware that when you place your JavaScript in an external file, you don’t need to surround the JavaScript code with SCRIPT tags. In fact doing this may keep your script from working properly.

Once you’ve moved your java code to a separate file, modify your main HTML page to reference the external JavaScript, like this:

In other words, scan your Web pages for appearances of the

Blogroll

© 2008 Farooque. All Rights Reserved. Designed by Farooque.com.
Entries and comments feeds. Valid XHTML and CSS.