Yes, you read it right! But this time, I got sidetracked again from creating my first plugin but for a very good reason (I think! haha!). Anyway, last week, I told you that my first plugin development project will be my own social sharing plugin right? And I was actually already around 10% finished, but I don’t know for some reason, I bumped into an old WordPress plugin that I got a long time ago when I was still hooked into SEO, and this is actually a keyword density checker plugin that calculates your keyword density real time as you write your article in WordPress.
What this plugin does…
This was a nice plugin to check your keyword density, but the only thing with this keyword density checker plugin is that it provides the keyword suggestions to you and the suggestions it provide are the only ones that can be selected and not the seed keyword, and my issue with this is that what if I don’t want those keywords and what I want to check for the keyword density is the seed keyword? So I actually have no use for it at the moment because I currently do my own keyword research, and what I really need is a plugin that can calculate the keyword densities of my researched keywords.
So my curiosity got into me again and I tried to tinker with the plugin and I found a way to modify it to suit my need – the result was a plugin that can calculate the keyword density of my selected keyword. Neat isn’t it? Below is the screenshot of the final result of the plugin
How this plugin works
To make this plugin work, what you just need to do is to enter your desired keyword in the text box at the “Type Your KW Here” metabox and press “Check Density”, and after that, the keyword will be put into your watch list and that’s it! The next thing that you need to do is just type your article and the plugin will calculate the keyword densities of your chosen keywords in real time as you type your article.
Calculating Keyword Densities
As for the keyword calculation, I also changed the formula because its initial formula is
Keyword Density = (Nkr * Nwp / Tkn) * 100
Nkr = Total number of keywords
Nwp = Number of words in the phrase
Tkn = Total number of words
And as per Wikipedia, this was actually not the best way to calculate it because keyword density refers to the frequency of appearance of a particular keyword in an article, so I changed the current formula to the recommended formula, which is:
Keyword Density = ( Nkr / ( Tkn – ( Nkr * ( Nwp – 1 ) ) ) ) * 100
So there it is. It now calculates the keyword density as per the ideal keyword density formula
The plugin is still not done yet because I am still doing some minor tweaks, but is around 95% complete already. I also don’t know if I can already call this my own, but I think yes because I guess what’s left from the previous code is only around 10%, so what do you think?
Anyway, I actually want to share it to anyone who wants it and I know it will be useful to someone, especially to those who are very particular to their keyword densities, so if you like to try my plugin, just let me know by commenting below and I will give you the link once I have completely finished it 🙂