draft
is not a post_type
, it’s a post_status
. So you should use your second block of code with that substitution:
DELETE a,b,c
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON (a.ID = b.object_id)
LEFT JOIN wp_postmeta c ON (a.ID = c.post_id)
WHERE a.post_status="draft"
Related Posts:
- Delete post revisions only for a single post
- How Can I Always Display A Particular Post First Using WP_Query?
- Change permalinks in posts via SQL
- How to limit the number of posts that WP_Query gets?
- When is the ‘post_content_filtered’ column in database cleared by WordPress?
- Should we trust the post globals?
- Can posts have parents?
- Where is the old post permalink slug stored?
- Separate Database Tables For Different Post Types
- Random sort within an already sorted query
- how to get a different html for odd/even posts?
- How can I safely increase the character limit for post passwords?
- How to Group Posts by the First Letter or Number?
- Restore contents of deleted user
- How are terms connected with posts in database?
- How to know if get_posts() failed?
- Moving WordPress to new server: no posts found
- Using $wpdb to query posts with meta value containing current post_id
- Query posts from current year
- WordPress Number of Posts Not Changing With posts_per_page
- I have over 4000 posts, will querying some of them cause performance issues?
- Duplicate posts
- Looping through posts per category gives same posts for each category
- How to show posts rank based on custom field value
- How do I create Comma Separated list of attached image ids?
- Custom Taxonomies Incorrectly Counting Revisions?
- How to add posts to wp_query result?
- Trying to put an array into ‘post__in’ => array() query not working
- Order post by year DESC and month ASC
- Should ‘setup_postdata()’ be reset with ‘wp_reset_postdata()’?
- How can I display a specific user’s first published post?
- database columns: post_title vs post_name
- Sanitizing `wp_editor();` Values for Database, Edit, and Display
- Query All users that has post
- Exporting Data from WordPress into a flat table
- wp_enqueue_media() slows down my WP site
- How can I get all posts data from within a paginated search result?
- Insert posts in two tables
- Instead of submiting an entire post, is there any way to submit a lite-post or a simple message?
- Importing New Posts from Live Site into Local Dev Site
- Search query – exact post title match
- Sorting posts alphabetical that have single digits
- Query posts from different categories in multisite
- Check if post exists
- posts_per_page doesnt work
- Sorting posts according to view counts not working
- Display page content AFTER a loop of posts
- Manually removing revision post types
- Only display posts after current date
- Get posts by multiple ID’s (query)
- How much of my site can I recover from public_html?
- How to start with post number x?
- Exclude posts with empty post_content in wp_query
- Reset/Reorder posts ID in the MySQL wp_posts table
- Only display a certain number of posts, dependent on how many posts there are available in a query
- How to store an extra (surrogate) ID when creating a post with wp_insert_post?
- How do I find which articles are missing a featured image in The WordPress database?
- Improving WP_Query for performance when random posts are ordered
- Should $found_posts be returned as string in ‘found_posts’ filter hook?
- Split WP_POST table based on post types
- Most recent post from another database
- What structure should post_content have in the database?
- Multiples Empty Posts were created and cannot delete them
- Query how many items to show in shortcode
- Get posts by name and taxonomy term
- WP_Query Authors OR Categories
- Get Posts that are in the current month or later
- How to delete all the content of a wordpress site without deleting the Post and pages?
- Sticky post appears twice
- do_shortcode within post query
- How Can I Query a Specific Page From a MultiPage paginated Post
- Extracting post categories
- How to modify post content?
- Get Meta Key Value While Saving Post
- Most liked page not displaying posts
- Query get post,how to add comment box
- After database migration, posts not showing up in dashboard
- filter RSS feed in URL
- WordPress custom Query for Posts in Category display posts multiple times
- Transferring WordPress Database – Serialised data
- Emojis replaced by ‘?’ automatically
- get query() without post content?
- WordPress Local And Live Site
- How can I setup a relationship using categories in WordPress?
- Exclude the first ‘n’ number of posts of a tag from home page?
- Can’t update old posts 3.5.2
- Copy post to separate database with “add_action(….)”
- posts_per_page option limits the number of Gallery items
- How i can limit period of post publication?
- When open add new post or page WordPress add post with ID=0 continuously [closed]
- wp_posts table: safely remove unused columns to save database storage
- Anyone know why wordpress converts some html entities to their numeric equivalents?
- How to setup a query to output posts by groups of five?
- Remove a shortcode from all WordPress posts
- What do these phpMyAdmin errors mean on my WordPress databaes?
- Exclude current custom post on single post
- What happens if I delete all the rows that represents a post revision from the posts table into WordPress database?
- Dynamically switch template on click
- How to get posts and comments amount per hour, per year and per month?
- Get all custom post types excepted some…