For whatever reason, I have a post and a page with the same slug name and it causes the db to hang. I can’t alter the slug on either so I need to go manually delete the posts from the database and start over.
Now, I am willing to go pull up the post ID from wp_posts and wp_postmeta and manually delete each entry. Will this screw up anything else in the database assuming I have no comments on either post or page?
EDIT
I found this script and I think it’s ok but I’m not sure if this takes care of revisions or anything else I would leave behind from manually deleting the post
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.ID = xxx;
Drop this into a file in your plugin directory and you should be able to do this from your WP installation using a query string.
All you need to do is make sure you’re logged into an administrator account, then visit: http://yourdomain.com/wp-admin/?delete_post=POSTID
I recently had this issue with a post-type I wanted to nuke, relationships everywhere and no DB enforced FK cascade.
Are you using any plugins that create tables? (like post-2-post)
its probably easier to use the built in WP functions… but if you need SQL calls for this look above.
why not simply use wp_delete_post() ?
When the post and page goes, everything that is tied to it is deleted also. This includes comments, post meta fields, and relationships between the post and taxonomy terms.
Expanding on @Brian Fegter’s answer Above you could use the below plugin to remove posts in bulk. It creates a WP admin page with a text area for ids of pages/posts to remove.
Ok, if you want to delete it completely, you have to delete post/page from
wp_term_relationships
table. But if the issue is only in the slug, you can update appropriate record in database and your slugs will be fixed. To update slug you need to run such query: