How to Clean HTML Code
May 14, 2012
Joshua Texeria – Raleigh, NC
123Triad: Web Design & SEO Company
How to Clean HTML Code
Clean code is one of the most underrated practices in web design. A site may look impressive on the front end, but messy code affects it in terms of site loading, compatibility, and search engine friendliness. HTML editors may have made it easier, but they won’t do all the work for you—you still have to manually streamline your code if you want it to run the way it should. This guide can help you get started.
Meta tags
You’ll probably want to keep the title and description meta tags, as they play a big role in search engine traffic. Some people think the keyword meta tag is unnecessary, but it depends on how much weight you put on your rankings. If most of your traffic comes from Google, they may be worth keeping in your code. Most other tags can be safely left out, as long as they don’t play a big role in your content structure.
Paragraphs and line breaks
A lot of websites have empty paragraph elements (<p> and <br> tags) simply meant to distance text blocks from each other. Remember, the browser has to read through all these tags when loading, so those extra breaks can really slow down your site. Using CSS to format your paragraphs can help you achieve more consistent spacing and reduce code at the same time.
Font formatting
The font tags and attributes have mostly been ruled out in HTML 4.01. Most, if not all, of your formatting should be in a style sheet. A CSS script keeps all the style information separate from the page, so it loads independently and doesn’t wait for the font tags to be read. The same applies to formatting in tables, pages, background, and link properties.
Incorrect characters
If you’re copying code from a word processor, a few “invisible” characters may turn up in your source code. This is because Word automatically translates formatting into web-ready versions, which isn’t always efficient. As a first-line measure, paste the code onto a text file before recopying to your HTML program. This removes any formatting and reduces the character errors when you start manual cleaning.
123Triad webdesign offers affordable custom website design. Our full service website design company only hires certified website designers. Please contact us today on 1-800-720-0816 for your next web site design project.
![]()
Related posts:












Servicing Nationwide
Call 1-800-720-0816 For your Free Custom Quote