Home › Forums › Calendar Products › Event Aggregator › iCal import feature is importing all the same events again over and over
- This topic has 7 replies, 5 voices, and was last updated 6 years, 8 months ago by Victor.
-
AuthorPosts
-
December 1, 2016 at 10:12 am #1200431Jeff NewmanParticipant
Hello. One of my import ICS URLs reimports all the events each time it checks. I now have over 34,000 events.
Two questions,
1) Why is it doing this?
2) How do I easily get rid of all those events?December 1, 2016 at 10:13 am #1200432Jeff NewmanParticipantThis reply is private.
December 2, 2016 at 1:04 pm #1201037HunterModeratorHey Preston,
Sorry to hear you’re experiencing issues! We actually have a logged bug which is set to get patched in the next maintenance release which should fix the issue of duplicate events every time the import is ran. I notice you’re still using the iCal Importer plugin. If you’re not already aware, we are in the process of sunsetting that plugin and have recently introduced Event Aggregator. You have an active license which is set to expire the same date as your iCal Importer license. More info on moving to Event Aggregator can be found here. It is recommended you make the transition sooner rather than later.
For the time being, you can use the following snippet to help delete the duplicate events. Add it to your theme’s functions.php file. Please stay tuned to our Release Notes and the plugin changelog for maintenance release info.
Let me know how things work out and enjoy the upcoming weekend. Cheers!
/*
* Deletes the saved copy of "deleted" events generated by iCal Importer
* This allows you to re-import events. The script deletes 50 instances per page load
* Code by Nico; enhancement by Andras
*/
function del_deleted_events () {
$posts = get_posts( array( 'post_type'=>'deleted_event', "posts_per_page" => 50, 'post_status' => 'trash', ) );
if (!empty($posts)) {
foreach ($posts as $post) {
wp_delete_post( $post->ID, true);
}
echo '<p style="background-color:yellow;z-index:1;text-align:right;">50 deleted events removed, refresh again';
} else {
echo '<p style="background-color:yellow;z-index:1;text-align:right;">Done deleting!';
}
}
add_action( 'admin_init', 'del_deleted_events' );December 8, 2016 at 1:18 pm #1203457Jeff NewmanParticipantHunter,
Thank you for your detailed reply. I was able to follow the instructions to move towards the Event Aggregator. However, the step where a message was supposed to show up and ask to import the items from ICal never appeared. Not a huge deal as I could recreate them but it would be nice to have had it.
I attempted to put the code you provided in my functions.php file in my child theme but after putting it in it disabled the site causing 500 errors so I removed it. Any suggestions on dealing with this and getting these 30,000+ events out of my database? By the way, if we get this snippet of code to work, how do I then use it?
Preston
December 8, 2016 at 2:34 pm #1203543HunterModeratorHey Preston,
Thank you for the update and the valuable feedback. I have noted it and we will take it into consideration for an upcoming maintenance release. Another route would be to use a plugin such as Bulk Delete to clean up the deleted events.
With the amount of deleted events you have, the snippet I provided would take quite some time to clean up them from your database. If you did choose to go that route, you can get a revised Twenty Seventeen functions.php file here. To use it, simply replace the code on your site’s Twenty Seventeen theme’s functions.php file with the code from the Pastebin link provided. Once you’ve saved your changes, 50 events will be deleted every time you visit/refresh a page on your site.
Let me know how things go and have a good afternoon. Cheers!
December 30, 2016 at 8:35 am #1211785Support DroidKeymasterHey there! This thread has been pretty quiet for the last three weeks, so we’re going to go ahead and close it to avoid confusion with other topics. If you’re still looking for help with this, please do open a new thread, reference this one and we’d be more than happy to continue the conversation over there.
Thanks so much!
The Events Calendar Support TeamAugust 11, 2017 at 4:28 pm #1334293VictorKeymasterHello Preston!
Just wanted to share with you that a new maintenance release (for the Week of 7 August 2017) is out, along with some Event Aggregator server improvements and fixes that should solve this issue.
Find out more about this release → https://theeventscalendar.com/maintenance-release-week-7-august-2017/
Please update the plugins and see if the fix works for your site. Don’t hesitate to open a new topic if anything comes up.
Best,
Victor -
AuthorPosts
- The topic ‘iCal import feature is importing all the same events again over and over’ is closed to new replies.