Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save basilesimon/2526cd881068a7559c8082fd06b3fafe to your computer and use it in GitHub Desktop.
Save basilesimon/2526cd881068a7559c8082fd06b3fafe to your computer and use it in GitHub Desktop.
SQL - Wordpress Word Count across *all* pages
SELECT SUM(LENGTH(post_content) - LENGTH(REPLACE(post_content, ' ', '')) + 1) as 'Word Count' FROM `wp_posts` WHERE post_status='publish' AND post_type='page';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment