Twelve Simple Ways To Write Search-Friendly HTML Code


This morning I was handing off a project to a developer and found myself ranting about the common mistakes developers make when coding HTML. These boneheaded mistakes can cause search engines to choke when it comes to indexing your websites. And its easy to avoid making these mistakes. Here’s how:

  1. Don’t repeat yourself. Use server side includes for headers, footers, menus, and standard <head> items such as links to CSS documents and external JavaScript files.
  2. Balance tags in server side includes. If an include file starts with <div> it should end with </div>. This way each file can be viewed in Dreamweaver design view, and includes files do not depend on each other.
  3. Place JavaScript in external files and reference them as needed.
  4. Each page must have a unique <title> and <meta name=”description” content=”This is a sample.”>. Don’t put these in server side includes.
  5. The title should be <title>Name of Company - Name of Page</title> or <title>Name of Company - Name of Category - Name of Page</title> unless you are told otherwise.
  6. The description should be the first one or two meaningful sentences of content unless you are told otherwise.
  7. Please make all links and references to images, CSS and JavaScript root relative by starting them with a slash, "/". If you use Dreamweaver, set the “Links relative” option to “Site root” in the Site Definition wizard. Root relative links don’t break when files are moved from one directory to another.
  8. Too many files in one directory makes things hard to find. Use subdirectories.
  9. Run your code through a validator and keep it clean. Removing trivial errors makes real errors easier to spot.
  10. Use CSS with HTML elements like <div>, <span>, <p>, <h1>, and so on, to format things. Only use layout tables when they produce better results or cleaner code than CSS.
  11. Use heading tags, unordered lists and numbered lists to organize content rather than spacer graphics and nested tables..
  12. Consistently use the simplest URLs. Link to “/” instead of “/index.php” or “/news/” instead of “/news/index.php”.

These recommendations may help sites work better, make pages look good on different browsers and mobile devices, cause pages to load faster, save money, and boost search traffic. If you’d like to discuss or debate these ideas, meet me at SMX Advanced Developer Day.

Jonathan Hochman has two computer science degrees from Yale. He is a principal of Hochman Consultants, an internet marketing firm.

Opinions expressed in the article are those of the guest author and not necessarily Search Engine Land.



Jonathan Hochman has two computer science degrees from Yale. He is a principal of Hochman Consultants, an Internet marketing firm.

See more articles by Jonathan Hochman >


Share, Bookmark & Discuss This Article
More:


Keep Updated: News Via Email | News Via RSS Feed | News Via Twitter


See more stories like this in the Members Library! Check out the SEO: General sections of the Members Library where this story is filed. Members also get access to exclusive video content, a members-only weekly & monthly newsletter, plus more. Check out all the benefits!

Comments are closed.


RECENT COMMNENTS

  • Eric Ward said " OK, so I was trying to be ironic/funny with my maniacal idea for aggregating all my personal comment"
  • JohnWEllis said " Greg, Thanks for sharing this data. No good comes from asking people what ads are “helpful”. People "
  • Shari Thurow said " Hi Nick- Yeah, I hate the schmoozers, too. I chose to ignore them because they don't usually last lo"

See All »


FREE DAILY SEARCH NEWS RECAP!

Stay on top of all the search news with our daily summary, the SearchCap newsletter. View a sample ›

STAY CURRENT THROUGHOUT THE DAY

RSS Feeds

The Search Engine Land feed keeps you informed as news happens. SEE ALL FEEDS »

Upcoming Search Engine Land Conferences

Advertise With Us »

Search Engine Land produces SMX, the Search Marketing Expo conference series. SMX events deliver the most comprehensive educational and networking experiences - whether you're just starting in search marketing or you're a seasoned expert.


SMX Web Site » | SMX Difference » | SMX News »


Join us at an upcoming SMX event:

Search Marketing Now Learn more about search marketing with our free online webcasts and webinars from our sister site, Search Marketing Now. Upcoming online events include:


See more webcast topics »

TRACK US SOCIALLY
Upcoming Search Engine Land Conferences

Get Your Search Engine Land
Premium Membership!

Become a premium member today and receive:

  • Express commenting privileges & photo.
  • Exclusive videos & newsletters.
  • Discounts to our SMX conferences.
  • Access to "How To" & Other Archives.

Learn More

Upcoming Search Engine Land Conferences
Add to GoogleAdd to My Yahoo!Add to BloglinesAdd to NetvibesAdd to Windows Live