WordPress SQL for post, category, user data
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 | |
p.ID, | |
p.post_author, | |
p.post_date, | |
u.display_name, | |
p.post_title, | |
p.post_content, | |
t.name | |
FROM wp_posts as p | |
INNER JOIN wp_postmeta as pm ON (p.ID = pm.post_id) | |
INNER JOIN wp_term_relationships as tr ON (tr.object_id = p.ID) | |
INNER JOIN wp_term_taxonomy as tt ON (tt.term_taxonomy_id = tr.term_taxonomy_id) | |
INNER JOIN wp_terms as t ON (t.term_id = tr.term_taxonomy_id) | |
INNER JOIN wp_users as u ON (u.ID = p.post_author) | |
WHERE p.post_type = 'post' | |
GROUP BY p.ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment