Delete all posts and associated meta data that are not custom post types

401 views Asked by At

I want to remove all posts that are not custom post types from the wp_posts table, and along with it delete any related wp_posts_meta , wp_comments , wp_comments_meta and anything related to those posts.

I'm just not sure what syntax to use.

I have a development site that has old data and I'd like to import all post data from the live site before I launch. Everything I'm finding on stackoverflow is about deleting specifically things like authors and their related posts. I want to delete everything from every author so I can run the import with everything.

0

There are 0 answers