Skip to content

Instantly share code, notes, and snippets.

@manuelricci
Last active August 16, 2021 05:46
Show Gist options
  • Save manuelricci/106a4cb6ab29e73fb23beb85e949e6f1 to your computer and use it in GitHub Desktop.
Save manuelricci/106a4cb6ab29e73fb23beb85e949e6f1 to your computer and use it in GitHub Desktop.
Query to delete all the records of the events created with The Events Calendar
/*
How to use it:
1 - Change the table prefix `wp_` if the one in the db is different
2 - Execute the query
3 - Done 🎉
*/
DELETE a,b,c,d
FROM wp_posts a
LEFT JOIN wp_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN wp_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN wp_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN wp_terms e ON ( e.term_id = d.term_id )
WHERE a.post_type = 'tribe_events';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment