Counting Average Number of Posts

Recently I was asked by MPOW to determine the number of new posts that we added to our blog in a day. To count the average number of posts we add in a day I used the following SQL script.


SELECT COUNT(p.id) as post_count
FROM wp_posts p
AND p.post_date IS NOT NULL
AND DAYOFYEAR(p.post_date) IS NOT NULL
GROUP BY DAYOFYEAR(p.post_date)

Leave a Reply