When I delete a bunch of posts their custom fields remain in the database, is there a way to remove them as well on deletion?
Tell me more
×
WordPress Answers is a question and answer site for
WordPress developers and administrators. It's 100% free, no registration required.
|
The best way to do this is to use the wp_delete_post function as follows:
This function accounts for comments, term_relationships, posts.post_parent, and postmeta. |
|||||
|
