Hi The tables that you need to consider is
wp_posts – Which contains all the details about the posts.
wp_postmeta – Which is used to store the meta details for a post with relation to post_id.
Query will be
Select * FROM wp_posts a, wp_postmeta b WHERE a.post_status="published" AND a.post_id = b.post_id AND b.meta_key = 'Your Custom Field';
wp_terms, wp_term_relationships contains the terms and tags which is related to a particular post.
wp_terms – tag details.
wp_term_relationships – how each term is related to a particular post. (object_id = post_id)
Cheers Happy Coding.
Related Posts:
- How to add an admin notice upon post save/update
- Passing current cookies in wp_remote_get to get Draft Post Preview
- Listen to Post action
- Export WordPress Posts and Meta Information in CSV format
- Manipulate post category after time
- how to get permalink using sql
- WooCommerce – Create Products Programatically [closed]
- which action to hook to in order to perform post-publish action
- Cannot access current post’s ID in custom plugin
- Set number of article per number of page
- How to change post status from publish to draft using hook in wordpress?
- prevent showing posts of an specific category in admin posts section
- Use Cron to modify posts via sql
- Sql syntax error
- Using radio button meta data from a custom meta box
- get posts and postmetas in assoc array
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- Global $post not working in OOP function WordPress
- How do I find which articles are missing a featured image in The WordPress database?
- Bulk update post slugs through database
- Get the most repeated post contents from a search?
- Multiples Empty Posts were created and cannot delete them
- Define a wordpress constant through plugin functions?
- Delete WordPress posts from URL list sql query
- SQL query to retrieve all the records that have not indicated category
- How to get post bulk edit action trigger and get edited post ids?
- How to verify wp user password by sql query in wp? [closed]
- Get ALL post ID’s export list (Only id’s. Php or sql not important )
- updating a post doesn’t trigger a function
- Hide a specific category in admin All Posts page (WordPress)
- Prevent Delete Attachment by URL or When Submit
- What hook do you use to update a post?
- Updating post data on save (save_post vs wp_insert_post_data)
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- WordPress website loads more posts than expected
- SQL Command for restoring trashed comments
- Filter Hook for post table (not columns)
- How to Assign / Move all Deleted post to a category
- Migrate posts from category and sub-category via SQL
- why str_replace targeting pages instead just targeting post?
- Get author posts count after excluding a category
- Stop post submission without losing data?
- Cant’ Grab WordPress Built-in Posts Through Loop
- How can my plugin display a populated new post window
- search content of pages and list in wp-admin
- SQL Bulk Move old posts by one author to another category
- Finding a post’s slug
- Insert specific information to a posts of a predefined category
- Open a wordpress single post in a lightbox without the header and footer
- Export all posts to import as product items
- How can I get posts from 9/13/11 to today with SQL? [closed]
- Change published date and time using SQL query for page in every 5 hour
- SQL DELETE multiple post_meta on single and multi-sites
- WordPress: Develop multiple posts with different data
- Bulk find & replace on WordPress posts/pages (minus image paths)
- SQL query: select duplicate posts – but using duplicate meta [duplicate]
- WordPress MySQL Search and replace with wildcard?
- Using a meta_value or postdate to to query and orderby
- insert post fails after multiple postings
- Adding wordpress posts using phpmyadmin
- How do I change the post title’s link on the posts page?
- How to run select query of post with category and tags?
- Update user meta when post published no working
- Fixing the WP Post Object for Custom Route
- Custom plugin to get related posts by category
- Query to get data of a post, if in category?
- Can’t create posts with WP DB Abstraction Plugin
- SQL query to remove first image in all posts
- Delete junk text from all the post using my sql command
- Special Query: Title, Terms, Content – %LIKE%
- Hide the contents for specific post
- If meta_key exists then don’t select this post?
- The page that displays Posts on homepage
- Error 404 blog/page/2/
- Onclick open posts displayed in slider in a popup [closed]
- How do I save JS classes being applied to the WP dashboard via custom plugin?
- Change permalinks in posts via SQL
- Batch Scanning and Deleting Empty WordPress Posts
- Let private posts stay in status “private” after edit through “editors”
- Exclude posts that only have the ‘Uncategorized’ category [duplicate]
- Display most recent post in category instead of archive?
- Display the latest posts, published in the last hour, with WP_Query
- Allowing the SoundCloud player to appear in a post excerpt
- Server-side sorting of posts
- How to change wordpress dates to native language (even if the languge not available i wordpress)
- How do I exclude the current post from listing in recent posts
- Custom post types related to same custom post type?
- How To capitalize The First Letter Of Every Word In The Post Title
- Show post content and title in diferent divs using WP_Query using a loop
- Custom WP_Query not working correctly
- created post displaying differently on front end
- MYSQL: Create SQL query to search for string and replace
- WordPress empty page! what is wrong with this code?
- How to prevent post update using transition_post_status
- How to display max. 2 sticky posts when posts_per_page is 3?
- Count posts for pagination
- Custom Post Type doesn’t use single.php or single-{custom_post_type}.php
- how to remove entry meta from wordpress archive category and change its display
- Error establishing a database connection
- How to limit the number of posts a user can publish based on user type