Created
July 26, 2021 22:23
-
-
Save ajskelton/915675de94d914bbadd9bcef965c3cbc to your computer and use it in GitHub Desktop.
WordPress SQL Query for finding posts that have a specific acf value
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 * FROM wp_posts | |
LEFT JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id | |
WHERE wp_posts.post_status = 'publish' | |
AND wp_postmeta.meta_value = '%ACF_FIELD_VALUE%' | |
ORDER BY wp_posts.ID |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment