SEO Tips and Tactics – Code to Text Ratio?
The other day we started talking a little about text to code ratios. That’s the correct way to state it. However, many people, and a large number of sites refer to it as a text to code ratio. I’ve even fallen victim to the incorrect nature of the phrase and have been known to talk about code to text ratios because the phrase is used so often. If you think about the ratio itself though, it’s really not a code to text ratio. It’s a text to code ratio. Symantics aside, let’s talk about a few ways to increase your text to code ratio (or code to text ratio if you prefer.)
First of all, the goal is to have lots of content compared to the amount of code required to create it. Look at it this way. Try to have more content than code. That will automatically yield a high text to code ratio.
So how do you do that? Here are a couple ways.
Write tons of content. Simple as that. Make pages with more than a thousand words and your text to code ratio will likely be pretty high. However, poorly programmed pages just generate more code to format more content and it’s a never ending cycle of adding more code and more content so the ratio never climbs.
To increase the text to code ratio, use CSS to write you pages. CSS is so clean that the pages naturally create high text to code ratios. But I’m not just talking about using CSS to define your font styles. You have to use it to lay out the whole page.
Limit your use of large scripts. If you use things like javascript drop down menus, you’re likely adding hundreds of lines of extra code into your pages. It’s still okay to use javascripts, but you have to externalize the scripts themselves. Just save the javascript into a file all by itself and reference the script in your page. That way, the hundreds of lines of code are not calculated into the text to code ratio and your page appears to be cleaner.
Create highly optimized pages that limit the number of links, images, scripts etc. Sure, you can use all of those things in the main pages of your site, but consider creating a select few pages that are optimized by eliminating extra things that only bloat your code.
Never use tables. With the advent of CSS, we were finally able to eliminate the dreaded table from our design. Now you can define position and color and size without the use of a table. Every single cell in atable requires multiple definitions to describe the length, height, position, color, background color, padding, cell spacing etc. These elements can really begin to bloat the code when you have a table with 6 cells and each one has a table nested within it. Eliminate tables in favor of table-less CSS and Google will reward you.
Chadd Bryant
Internet Building Codes