Bulk delete (custom type) posts that are not visible on website

I suggest you use MySQL “DELETE”. See this article:

http://www.mysqltutorial.org/mysql-delete-join/

So, something like this:

DELETE wp_posts, wp_postmeta
FROM wp_posts
INNER JOIN wp_postmeta ON wp_posts.ID = wp_postmeta.post_id
WHERE meta_key = 'expiry date' AND meta_value <= '2017-11-27' AND post_status != 'publish'

NOTE: ‘wp_’ could be different depending what your table prefix is set to in your wp-config.php file.

This should get rid of all posts in the posts table and all of the meta records in the meta table. It will also get rid of drafts/revision.

DOUBLE NOTE: -SUPER IMPORTANT- Don’t do this unless you have a backup of your database.

tech