Skip to content

Instantly share code, notes, and snippets.

@fgilio
Created August 2, 2016 13:53
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save fgilio/ddfb89f76c388e5b96cb5eb567023e3c to your computer and use it in GitHub Desktop.
Save fgilio/ddfb89f76c388e5b96cb5eb567023e3c to your computer and use it in GitHub Desktop.
WordPress average post character length for a given month
SET @start = '2016-1-01';
SELECT AVG(CHAR_LENGTH(post_content)) AS avgLength
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
AND post_date >= @start
AND post_date < @start + INTERVAL 1 MONTH;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment