Last active
November 14, 2019 14:29
-
-
Save milindmore22/4819aa069dce461e845b75413aa3688f to your computer and use it in GitHub Desktop.
SQL Query to get post count by post types
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SELECT count(*), post_type FROM `wp_posts` WHERE post_type IN( SELECT DISTINCT post_type wp_posts ) GROUP BY post_type ORDER BY `count(*)` DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment