Created
June 19, 2019 03:03
-
-
Save dgowrie/8e6a025c09a2a5676c457285d32731b5 to your computer and use it in GitHub Desktop.
SQL query for posts using specific page template in WordPress
This file contains hidden or 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_title, ID, post_status, post_name | |
FROM wp_posts p | |
LEFT JOIN wp_postmeta m | |
ON p.ID = m.post_id | |
WHERE (m.meta_key = '_wp_page_template' AND m.meta_value = 'default') |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment