Get Free Quote

BACK TO BASICS: What You Can Learn by Looking at Your Competitors' Source Code

By Paula Allen, September 15, 2008

Though your Web site may not rank at the top of the search engine results yet, someone's does. The search engines find those top-ranking Web pages to be the most relevant for your keywords, so those sites are, in turn, your online competitors. As with any type of competition, it helps to know who you're up against. This article lays out a list of things you can do to size up an opponent by reviewing their site and source code.

In addition to all of the handy competitive analysis reports you can run on their Web pages (such as keyword density, server checks and others), don't overlook the obvious: looking directly at the Web pages themselves. Go ahead and travel them like a user and see what kind of experience the pages offer. But since search engines can't see all the bells, whistles, games, pictures, and other content that a human can, you'll also want to read these pages the way a spider would -- from the back side.

Behind every Web page's pretty face is a plain skeleton of black-and-white HTML called source code. To see a Web page's source code, choose "Source" or "Page Source" from the browser's View menu. With a little knowledge of HTML, you can examine this source code and size up your opponents to find out how SEO-savvy they are, while you identify some important elements about the Web pages that could give you a competitive edge.

Viewing a competitor's source code is a bit like looking under the hood of a car. While no NASCAR driver would be given the opportunity to look under another team's hood, one can imagine how the ability to do so would be an advantage in the race. In the field of online marketing, the advantage goes both ways because just as you can view a competitor's source code, they too can view the source code of your site. But while the playing field may be even, webmasters working in a competitive space must use all the tools at their disposal to gain visibility in the search engines.

Looking at the source code, you want to get a feel for how the Web page is put together and notice any oddities. You may find that the page seems to be breaking all the best practice rules for good search engine optimization, but ranking well anyway. In a case like that, you can deduce that they must be doing something else very right, such as having lots of backlinks pointing to the page. At the other extreme, you might discover that this is a very SEO-savvy competitor that will be hard to beat.

To see if your competitor is doing things right, here are a few best practices to look for:

  • Formatting with an external .CSS file. Does this page use an externalized style sheet (.CSS) file to control the look and feel? That's the best practice for SEO because it reduces clutter within the source code, allowing the search engine spiders to get to the keyword-rich content within the first 100 lines of page code. An SEO-unaware site may use inline font tags that push down the page's main content, or style sheets that are defined at the top of every page instead of in another file, creating a huge glob of HTML code that bogs down their page load time and slows down the spiders. If this is the case, you may be able to get a leg up on this competitor, because they don't understand good SEO page design.
  • JavaScript in an external file, too. Look for any JavaScript code (it looks like undecipherable gibberish, not English). If the page uses JavaScript, it should also be off the page in an external .JS file (for the same clutter-busting reasons), and you should see only simple one-line calls to the .JS file within the page code.
  • White line spaces used sparingly, if at all. For best practice, a page should not have much white space between lines. Webmasters often include line spacing to make the HTML code more readable. Since every white line actually represents characters (spaces and paragraph returns), too much of this can dilute the content or require the spider to travel deeper into the source code in order to reach the content that contributes to rankings.
  • Content, and quick. A spider-friendly page gets to the meat within the first 100 lines of code. That means the keyword-rich text (the content users read) should not be too far down the page. We recommend limiting the code above the first line of user-readable text to no more than 99 lines.

Now let's get into some nitty gritty HTML code issues:

  • Doctype declaration: Does the page declare a Doctype (document type) in the first line of code and identify what type of HTML is used? If so, does the Doctype validate with W3C standards? Search engines look for this. (Note: You can run the page through some validation checkers at
  • Title, Description and Keywords tags: Look closely at the Head section (between the <head> and </head> tags). Each page should contain Title, Meta Description, and Meta Keywords tags, in that order. All the contents of these tags should be kept to a reasonable length, to avoid appearing like spam. For guidelines on Meta tags, see a previous SEO Newsletter article titled When to Use Meta Tags.
  • Other Meta tags: Are there any additional Meta tags in the Head section? Webmasters make up all sorts of creative Meta tags, sometimes with good reasons that outweigh the cost of expanding their page code. However, if the competitor's page has a hundred different Meta tags, you can be pretty sure they don't know much about SEO. Along with appearing to be spam, excessive Meta tags will cause the spider to travel farther to reach the content that contributes to rankings.
  • Heading tags: Search engines look for <h1>, <h2>, <h3> and so forth to help ascertain what the page is about. The most important keywords on a site should be incorporated into these Heading tags according to SEO best practice. See if and how your competitor uses these tags.
  • <Strong> for emphasis: Spiders expect to find keywords within emphasized text, such as words or phrases in bold or italic. (Note: For this reason, a page's body text should NOT be all bold.) Look at the tags used to set apart certain words within sentences. From an SEO perspective, the <strong> tag is better than <b> for turning words bold, and <em> (short for "emphasis") is preferable to <i> when creating italicized text.

Experienced HTML programmers can go a lot further in this analysis, but this list helps identify how SEO-savvy your opponent is. Now that you know whether you're facing a ragtag band of SEO grease monkeys or a well-equipped team of SEO technicians, you can look at your own site and better prepare it for the race ahead.

For permission to reprint or reuse any materials, please contact us. To learn more about our authors, please visit the Bruce Clay Authors page. Copyright 2008 Bruce Clay, Inc.