• Resolved simonc17

    (@simonc17)


    My orphaned events count now stands at 153. These are “potentially” orphaned. I don’t understand why there isn’t an option to list these events before deleting them as they could be valid.

    Does anyone know how to list these, even using an SQL query on the database?

    Thanks.

Viewing 2 replies - 1 through 2 (of 2 total)
  • There’s a database table for the events (wp_events) and one of the fields in that table is the post_id. If the post_id does not exist in the posts table (wp_posts) then it’s considered an orphaned event. To list all the orphaned events in the events table use the following SQL query:

    SELECT * FROM wp_em_events WHERE post_id NOT IN (SELECT ID FROM wp_posts WHERE post_type = "EM_POST_TYPE_EVENT" OR post_type = "event-recurring")

    If your wordpress table prefix is something other than “wp_” then change wp_ to the actual prefix.

    Since the post is no longer available you won’t be able to know the post description or the post meta fields that are not also stored in the events table.

    Thread Starter simonc17

    (@simonc17)

    Great! Many thanks for the help.

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘Orphaned events’ is closed to new replies.