Like keepkalm said I'd find the list of post IDs from the database:

select id, post_title FROM wp_posts
where post_title like '%Pharmaton%'
or post_title like '%Winston Blu%'
or post_title like '%Kefir%'
or post_title like '%Tetradox%'
or post_title like '%Passport Sco%';

and then use the list of IDs with wp-cli's wp post delete which accepts a space-separated list of post IDs:

wp post delete 1 2 3 4

(You could also use wp post list to get all titles and IDs in the system, and grep to filter the list down to the posts you want, awk or similar to extract the list of IDs and then pass that all to wp post delete in one go - but this feels safer to do as a semi-manual process since you're deleting things.)


You probably want to do something like that from the command line. Or in the database itself. Automatically delete might not be possible unless you can figure out how to run this as a cron job. Best practice would be to not publish them in the first place.

You can set the screen option in Posts to show 200-500 results and select all and delete also. Ten times or so is a lot easier than learning the command line or SQL. Less risk of crashing or breaking other stuff.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.