Designing Spider-Friendly Code for Better SEO Results - dummies

Designing Spider-Friendly Code for Better SEO Results

Whether you’re writing your own HTML or hiring a Webmaster to do it for you, you want to keep your Web site’s underlying code spider-friendly for better SEO results. Basically, you need to streamline your site’s code so that the search engine spiders have an easy time crawling your pages and figuring out what the pages are about. You do this by keeping the code as clean as possible. For search engine optimization (SEO), here are some coding best practices:

  • Use an external Cascading Style Sheet (CSS) file to define the look of your Web site.

  • Use an external .JS file to hold any JavaScript code you plan to use.

  • Use as little inline markup (formatting and other types of on-the-fly HTML codes, such as Font tags to define the font style, and so on) as possible.

Creating a CSS file gives you a source from which to control the look of your entire Web site. In your CSS file, you can define, for instance, that all H1 headings should be Arial, size 3, bold, navy blue, and centered. Next week, if you change your mind and decide to make your headings purple instead, you can simply edit the definitions for your H1 style in your CSS file and viola — every H1 heading throughout your entire site is now purple. That’s a lot more efficient than going page by page through your site, manually updating every instance of an H1 tag, and it eliminates the risk that you’ll miss one.

Not only is an external CSS efficient, but it also provides a few other big advantages. Having a CSS file allows you to remove inline formatting such as font tags from your page content and instead insert a CSS tag identifying what style to apply. The result is much less HTML code cluttering your pages and significantly less page complexity. Less code means smaller file sizes. Smaller file sizes mean your pages load faster for your site visitors, and the search engine spiders have less junk to wade through as they read your text. It’s a win/win/win for all involved!

If your site incorporates JavaScript, you want to externalize it as well, for similar reasons. Move the JavaScript off your individual Web pages and into a separate .JS file. Then your pages can include a single line of code that calls (that is, instructs the browser and spiders that the information in the file should be used in reference to the content on the page) to the JavaScript file, rather than tons of code on the page. Because JavaScript code can get really long and cumbersome, this decision alone may cut the size of a Web page in half. Less code makes for spider-friendly pages with uncluttered text and clear themes.

One online business implemented just these two best practices on their Web site, creating external files for their JavaScript and using CSS, and they reduced 20,000 lines of code to just 1,500. The keyword-rich content rose to the top of the page, and along with it their site’s rankings across their keyword terms in the search results.