WhiteSites Blog

How to measure your keyword density

Posted on Dec 26, 2008 by Paul White

Recently I came to realize the importance of keyword density.  I always knew it mattered in Google, but I never realized how much until recently when I got the top spot on google for one of my blog posts.  After alot of research I came to this conclusion on how it might be best to measure keyword density.

My way of determining Keyword Density


Load my webpage contents into a string object.( source code and all )
Convert the entire document to lowercase
Add some blank space padding between tags and content.
remove all HTML, Javascript, and CSS markup, leaving just the plain text
remove all blank spaces until we have a single space seperating each of our words.
load the words into a string array using the Split command.
Count how many words you have
Create a unique list of words from your first list ( removes duplicates )
create a int array to store the count of each word in the original list.
For each word,  multiple its instances by 100 then divide by the word count.
Display your list.

This may not sound very straight forward.  I have written some code that does this, and it works well, but the code is still a bit messy.  Eventually I plan to create a new website ( seo.whitesites.com) where I can publish some seo tools.

What about Meta and Alts?
One of the debates in the SEO community is whether or not image alt tags and meta tags should be included as part of your keyword density.  In the example about these would not be included.  I personally feel that the meta keywords tag does not matter to google.  Google seems to care more about the content that is viewable to the readers.

What about common words?


Some people think you should pull out common words like "to, from, where, what, ext".  I believe these should be included when calculating your keyword density. 

What Density should I aim for?


I would aim for around 2% for google.  Of course the longer your text the better.  Something else you may want to compute is the keyword density of your inbound and outbound links.  Outbound links can put you at the top if they are high quality in substance.  This is why directory sites seem to rank so high, as all their outbound links are going to other sites that have good keyword density.


Permalink
3669 Visitors
3669 Views

Categories associated with How to measure your keyword density

Discussion

No Comments have been submitted
name
Email Needed to confirm comment, but not made public.
Website
 
 
When you Post your Comment, you'll be sent a confirmation link. Once you click this link your thoughts will be made public.. Posts that are considered spam will be deleted, Please keep your thoughts and links relavent to this Article