What is the SQL query for deleting all posts in Trash from WordPress ?

Here’s the SQL query for deleting all posts in Trash in WordPress:

sql
DELETE FROM wp_posts WHERE post_status = 'trash';

This query will delete all posts in the “trash” status in your WordPress database. Note that this operation is irreversible, and all posts in the trash will be permanently deleted from your WordPress site.

Therefore, it’s important to make sure you have a backup of your site before running this query. Also, it’s recommended to only run this query if you’re sure you want to delete all posts in the trash, as there’s no undo function.