Yes you can.
To delete posts with inherit post meta, use following code:
DELETE
p,pm
FROM wp_posts p
JOIN wp_postmeta pm ON pm.post_id = p.id
WHERE p.post_name IN ('post-1', 'post-2', 'post-3')
Pass slugs array to WHERE clause.
If you want to delete only posts w/out postmeta (for some reason), use this code:
DELETE
FROM wp_posts
WHERE post_name IN ('post-1', 'post-2', 'post-3')
Related Posts:
- How can I get posts from 9/13/11 to today with SQL? [closed]
- Adding wordpress posts using phpmyadmin
- Export WordPress Posts and Meta Information in CSV format
- Manually delete post from database
- how to get permalink using sql
- Use Cron to modify posts via sql
- Sql syntax error
- get posts and postmetas in assoc array
- 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
- SQL query to retrieve all the records that have not indicated category
- 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 )
- MySql query to get posts with all meta and terms
- Bulk delete WordPress posts with phpMyAdmin
- WordPress website loads more posts than expected
- SQL Command for restoring trashed comments
- How to Assign / Move all Deleted post to a category
- Migrate posts from category and sub-category via SQL
- Need to change all links in page content but not in post content
- SQL Bulk Move old posts by one author to another category
- Export all posts to import as product items
- Change published date and time using SQL query for page in every 5 hour
- SQL DELETE multiple post_meta on single and multi-sites
- 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
- How to run select query of post with category and tags?
- get backup file from wordpress database in x days
- Export Posts with specific custom fields by sql
- 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%
- If meta_key exists then don’t select this post?
- The page that displays Posts on homepage
- Change permalinks in posts via SQL
- Batch Scanning and Deleting Empty WordPress Posts
- How to change the case of all post titles to “Title Case”
- Post/Page Preview Template
- How to remove bulk edit options
- Do I use custom post type or something else?
- ‘Invalid post type’ error when importing from one site to another
- Locked/Unlocked in title
- How to permanently delete a post meta entry?
- Inserting custom data to the_post() during loop
- Get Image tag from content of post
- Visting slug for ‘post’ post type shows 404 not archive?
- Automatically create a new page daily with last three posts
- Add filter to the end of the post
- How to add a class to each individual post?
- Indirect modification of overloaded property WP_Post::$ancestors has no effect
- How do I change the location of post-specific information?
- ACF to select posts not displaying on blog page
- How can I insert a new markup element after 4 posts automatically? [closed]
- the_excerpt is displaying excerpts of every post
- Post: how to set created date after post has been published [closed]
- WordPress loop not working on static front page
- Sidebar on single.php not showing up
- remove all custom post created
- Hide content from Post Preview
- How to get the next and previous image title from attachment or gallery?
- Pagination for posts inside a specific category
- Creating a redirect option for current page url
- How to edit a custom theme?
- WordPress posts have a different URL to the index
- How to put the author of the post in the comments?
- Blog posts pagination not working
- unable to write to the database while uploading images
- Post not using taxonomy template
- query posts with selected post ids first
- How can I create a Survey Form in WordPress that users can fill in and then submit the entire survey contents as a post?
- How to get value of a selected option from select tag and use it in WP_query to filter posts?
- wp_query args with relation
- Creating Ordered Query using Meta_key
- WordPress each user has each content for a page,how to do that?
- How to change post template via url?
- How to remove related post from home page
- Is there a Standard Format for Clean URLs for Archives of Custom Posts?
- Send/Publish a Post front end
- How do I list categories and the common categories for posts beneath those categories?
- Post restoration
- Insert new post for each user infinite loop error
- Last three posts not being put in order by date. How to fix this?
- WordPress sub-posts and permalinks
- Assign a link of a post to that contains that post?
- wp_query posts sorting doesn’t work
- Show List of Posts With Comments Open
- When and how will php code in a user made WordPress page be executed?
- wordpress pinboard theme [closed]
- There is a page on my website that doesn’t show in the Pages section of WordPress [closed]
- Difficulty hiding a span per a body class within WordPress
- Moving featured image to top of new post editor screen
- Display posts with id equal to relationship value
- Imported Posts missing summary text on staging site