Created
May 30, 2012 01:56
-
-
Save thenbrent/2832609 to your computer and use it in GitHub Desktop.
Count all words in all the posts of a WordPress site via MySQL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| SELECT SUM(LENGTH(`post_content`) - LENGTH(REPLACE(`post_content`,' ',''))+1) | |
| FROM `wp_posts` |
Author
Yes, assuming people don't do the old fashion "double space after a period". I only needed a general idea of word count (up to around 20% variation is fine) so either would be fine.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Wouldn't it be faster to calculate the number of spaces and then add 1?