Can't Load May Calendar

Home Forums Calendar Products Events Calendar PRO Can't Load May Calendar

Viewing 5 posts - 16 through 20 (of 20 total)
  • Author
    Posts
  • #1099690

    This reply is private.

    #1100006
    Brook
    Participant

    Wow! That is a lot of duplicate events. I am actually happy there are so many duplicates though, that is the best possible outcome in that the solution doesn’t require a more powerful server or anything.

    That’s a great idea to run a SQL query for this, I’m glad you’re comfortable with that. We have never had to delete so many recurrences for an event before, but I knew our plugin couldn’t be the only one to face so many duplicate posts. I found an excellent article from someone facing a similar problem, and below I have adapted query code to fit your circumstance. I do recommend reading the article yourself before running this, as it includes some helpful tips like making you backup your database before running any delete queries like this.

    First step will be to get the “post_parent” ID for this series of events. In your WP Admin try to edit the entire Series of events once again. This will take you to a URL like example.com/wp-admin/post.php?post=140&action=edit . Grab the post ID from this URL, in this case it’s 140.

    As the article says it’s first a good idea to preview the posts you are going to delete before deleting them. Swap out the X at the bottom for the post ID you just grabbed, in the case above we would make the bottom line WHERE a.post_parent = 140 . Now run the query. The results should be many thousands of posts all with the same title, your recurring event. If so, procede.

    SELECT *
    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_parent = x

    Now we are going to delete those results. Again swap out the X for your ID, then run this query:

    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_parent = x

    And there you have it, the fastest way to delete all recurrence of an event. This query will actually probably execute in a few seconds on your server, usually it’s quite fast. With all of those delete we only have one final step, go to your WP Admin and find the original event once again. There will be no recurrences, only the original event of the series. If I were you I would click Trash series on this event, then I would empty my trash. Now you can recreate the event.

    I don’t know if we entered something incorrectly or if this is an event bug. I don’t see anything on this event that would be able to produce this many records.

    I don’t know what caused this either, very puzzling. It could be some currently unknown bug that happened, it could be a conflict or some accidental setting that was input. That’s the reason why I recommended Trashing the remaining event above, just in case there is something corrupted in it deleting and starting over is safest.

    With the above done your site will hopefully be running faster than ever, and best of all free from errors. As ever if I can help along the way or if you have questions please let me know. I am stoked we have nearly fixed this!

    • Brook
    #1100190

    #1100191

    Fantastic work Brook! That query deleted 634,419 records.

    Everything is working well now.

    #1100205
    Brook
    Participant

    Excellent news! It was truly my pleasure to assist. I am sad this was such a pain for you, but hopefully going forward things will be problem free. Please let us know if you ever need anything else.

    Until then!

    – Brook

Viewing 5 posts - 16 through 20 (of 20 total)
  • The topic ‘Can't Load May Calendar’ is closed to new replies.