iCal import feature is importing all the same events again over and over

Home Forums Calendar Products Event Aggregator iCal import feature is importing all the same events again over and over

Viewing 7 posts - 1 through 7 (of 7 total)
  • Author
    Posts
  • #1200431
    Jeff Newman
    Participant

    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?

    #1200432
    Jeff Newman
    Participant

    This reply is private.

    #1201037
    Hunter
    Moderator

    Hey 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' );

    #1203457
    Jeff Newman
    Participant

    Hunter,

    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

    #1203543
    Hunter
    Moderator

    Hey 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!

    #1211785
    Support Droid
    Keymaster

    Hey 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 Team

    #1334293
    Victor
    Keymaster

    Hello 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

Viewing 7 posts - 1 through 7 (of 7 total)
  • The topic ‘iCal import feature is importing all the same events again over and over’ is closed to new replies.