Created
October 26, 2022 08:15
-
-
Save mustardBees/2df3170a5d1a41a6ec34114e4a56fe8d to your computer and use it in GitHub Desktop.
WordPress SQL query to return a count of each post type.
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 | |
post_type, | |
count(*) | |
FROM | |
wp_posts | |
GROUP BY | |
post_type | |
HAVING | |
count(*) | |
ORDER BY | |
count(*) DESC |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment