Skip to content

Instantly share code, notes, and snippets.

@xdissent
Created October 2, 2009 02:26
Show Gist options
  • Save xdissent/199412 to your computer and use it in GitHub Desktop.
Save xdissent/199412 to your computer and use it in GitHub Desktop.
SQL to get the WordPress word count for all posts.
SELECT SUM(LENGTH(post_content) - LENGTH(REPLACE(post_content, ' ', '')) + 1) as 'Word Count' FROM `wp_posts` WHERE post_status='publish' AND post_type='post';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment