Deleting 49k posts in bulk

[ad_1]

TL:DR have a site with 49k posts with a specific tag that I need to delete. Would take too long through the dash, via SQL is a nightmare and WP-CLI isn’t seeming to help either

I’m helping cull posts from a 550k+ post site currently. The posts I’m trying to delete have specific tags. The first tag had about 6k posts, and that what I started trying to delete. Via the dash would take forever so I went into a deep dive of trying to delete via SQL (phpmyadmin on wpengine) but encountered a lot of errors and ultimately could only delete 250 at a time due to the size of the wp\_postmeta table.

I then tried the WP-CLI? and it seemed to work with this command:

wp post delete $(wp post list –tag\_id=721998) –force

but attempting the same thing with a tag that has 49k posts I’m running into this error: “Argument list too long”

I’m curious if anyone else has encountered something like this or might have an idea of what I can do here.

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer