WordPress and MySQL: What’s Your Wordcount?
Thanks for stopping by my personal blog on Marketing Technology! Over 50,000 visitors a month find my content worth returning for, so don't forget to subscribe to the Marketing Technology Blog RSS feed or to the Marketing Technology Email to have new content sent directly to your inbox. You may also find my other business blog helpful, Social Media Domination.
There’s been some talk on blogs about the average size of a Wordpress post. Some light has been shed that Search Engines will only weigh the impact of the first x number of characters, where x is currently unknown. As a result, anything after that is simply a waste of words.

Image from Wordle!
I’m rather garrulous with my blog posts so I’m going to do some additional analysis and see if the popularity of the post from search results has any correlation to the word count. I won’t get too scientific, but I do want to take a deeper look.
How can I query Wordpress for Word Count?
MySQL doesn’t have a built-in word count function for MySQL, but as with every other unanswered question, some smart guy on the blogosphere already answered how to use MySQL to get a Word Count.
Here’s the author’s word count query modified for a Wordpress database:
SELECT `ID`, `post_date`, `post_type`,
SUM( LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`, ‘ ‘, ”))+1) AS ‘Wordcount’
FROM `wp_posts`
GROUP BY `ID`
HAVING `post_type` = ‘post’
ORDER BY `post_date` DESC
LIMIT 0, 100
I currently don’t subscribe to the ‘perfect post size’ since what really provides weight with a search engine isn’t simply the word count, but the number of links to that content. If you have a 2,000 word post that attracts a lot of link attention, then the right size of your post was 2,000 words.
Give me a few days on this and I’ll do a follow up!


Douglas Karr

Well, only as long as you write for Google, and not your readers…