I was unsuccessful trying to migrate a bbPress 1.0 instalation to the new bbPress 2.0 plugin on my WordPress, which made quite a mess on my wp_posts
table.
I solved that by deleting every posts who was carrying the values topic
and reply
to the post_type
column, and that was good.
But now I noticed that the wp_postmeta
seems affected by lots of entries refering to posts that I've deleted. Both tables have the post_id
column.
The question is: which SQL command I use to delete the values on wp_postmeta
referencing lines who aren't anymore on wp_posts
? I know it's some kind of join that I should use but I don't see how it would be to look for something who is not there and delete it.
PS: And what's up with WordPress tables not keeping referential integrity? I'm pretty sure it's possible to delete something automatically from wp_postmeta
when deleting something related on wp_posts
. Oh well…