Skip to content

Instantly share code, notes, and snippets.

@digisavvy
Created May 8, 2023 16:58
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save digisavvy/4cbd943d8106e5bfdd6e9ad5410a43da to your computer and use it in GitHub Desktop.
Save digisavvy/4cbd943d8106e5bfdd6e9ad5410a43da to your computer and use it in GitHub Desktop.
SELECT *
FROM wp_postmeta
WHERE post_id = {your_post_id}
AND post_id IN (SELECT ID FROM wp_posts WHERE post_type = '{your_posttype}');
With the above query, replace {your_post_id} and {your_posttype} with the appropriate post ID and posttype.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment