Recently I downloaded a plugin that had a bug that orphaned its custom post type items in the wp_post table rather than deleting them. Being new to wordpress, it wasn't apparent to me that the wp_postmeta table was related to that table. Now, I have entries in the latter with NULL values for the $post_id. (I simply deleted everything in wp_post with that content type.)
I'm assuming that it would be easy enough to do a left join query to find all those wp_postmeta items and delete everything with $post_id NULL. But, I'm not exactly sure how the wordpress tables relate to each other. If I were to do this manually, are there any other default tables that need to be taken into consideration? Does anyone have a script in their library to handle something like this?
If you can suggest a plugin, I'm open to that as well.