MAMP MYPHPADMIN Delete wordpress trash

Delete Trash from WordPress

Delete WordPress Trash from SQLAs I was testing on mij localhost (using MAMP) I run into trouble while permanently deleting several hundred products from my Trash.

Instead of using WordPress interface I decided to user MyPhPAdmin to do this. Whereas WordPress gave and timeout when only selecting a few products, via SQL the job was doen in less than 3 seconds.

Here’s the Code snippet:

DELETE wp_posts,wp_term_relationships,wp_postmeta,wp_term_taxonomy
FROM wp_posts 
LEFT JOIN wp_term_relationships ON ( wp_posts.ID = wp_term_relationships.object_id )
LEFT JOIN wp_postmeta ON ( wp_posts.ID = wp_postmeta.post_id )
LEFT JOIN wp_term_taxonomy ON ( wp_term_taxonomy.term_taxonomy_id = wp_term_relationships.term_taxonomy_id )
WHERE wp_posts.post_status='trash';
7566 Total Views 6 Views Today

Leave a Reply

Your email address will not be published. Required fields are marked *

Comments Protected by WP-SpamShield Spam Blocker