Created
April 13, 2016 22:10
-
-
Save elimn/2375dcd3e5ee4bcbf1ed86f5cbdb4620 to your computer and use it in GitHub Desktop.
MT | TEC | Truly delete all deleted iCal events
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
With events that were imported via iCal, when deleted the calendar still | |
remembers them a bit so they don't get reimported. This SQL Query will truly | |
delete all those events. | |
The query and steps below is modified version of that in this tutorial: | |
http://wpguru.co.uk/2013/02/how-to-bulk-delete-posts-in-wordpress-with-mysql/ | |
It is recommended that you read the source article above before proceeding. | |
In particular it mentioned the importance of making backups before running | |
SQL queries. :) | |
*/ | |
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 = 'deleted_event' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment