How can i count all WordPress posts published in a certain year(for eg. 2010) directly from the database using SQL?
PS: I managed to do it using the WordPress Api query_posts() function, but i would also like the sql query for it.
How can i count all WordPress posts published in a certain year(for eg. 2010) directly from the database using SQL?
PS: I managed to do it using the WordPress Api query_posts() function, but i would also like the sql query for it.
You must be logged in to post a comment.
Assuming you are interested in the published posts:
where
wp_posts
is the default posts table name, adjust with whatever prefix you chose if you changed it.Along the lines of