How do I get rid of the 687 phantom events?

This might be the reason why I’m getting error messages about duplicate primary keys. I don’t want to delete any rows in wp_posts because I don’t know if that would cause problems with wp_postmeta.

If possible, I’d like to be able to salvage the 13 events currently in the trash. If I can’t, no big deal.

I already try deleting and reinstalling the plugin.

https://www.evernote.com/shard/s333/sh/c3ca61aa-a67c-400f-b0ed-1fd4bf8f90b4/0cb6bec2ea9342d291b26672b2688bf6/deep/0/Events—Koga-Eikaiwa-Development-Site—WordPress.png

  • Vladislav
    • Dead Eye Dev

    Hi,

    It’s possible that what we’re dealing with here is a plugin conflict. The Events+ plugin will spawn “child” events for every recurring instance when saving the recurring event. This is a special-case event with a specific status, which makes for proper functionality of WordPress post counting etc (e.g. like auto-revisions don’t get counted). It’s possible that a plugin or a bit of code in a theme breaks the WordPress normative of post counting and doesn’t take into account the statuses.

  • richpav
    • WPMU DEV Initiate

    Vladislav,

    Would it be possible for me to delete the posts with an SQL query or a wp-cli command? What they all have in common is:

    post_status=recurrent_trash

    post_date_gmt=0000-00-00 00:00:00

    post_type=incsub_event

    I assume I can’t simply delete the columns from wp_posts because there probably are data in other tables that also need to be altered.

  • Vladislav
    • Dead Eye Dev

    Hi,

    You can safely delete the events with this status. You’re also right that there will be some leftover data in the postmeta table, but that should be the only other table with shared data. To clear that table up as well, as you delete each post, you will also want to remove the entries from postmeta table that share the common post_id with the ID of the post you just removed.