how do I remove all events from calendar

Home Forums Calendar Products Events Calendar PRO how do I remove all events from calendar

Viewing 15 posts - 1 through 15 (of 17 total)
  • Author
    Posts
  • #1418268
    besouro
    Participant

    how do I remove all events from calendar

    #1418415
    Crisoforo
    Keymaster

    Hey Bryan!

    I hope you are doing great, at the moment we don’t have a built int functionality to do so but WordPress comes already with a Bulk Edit feature that you can use to do this. We already have a series of steps that you can use in order to do this.

    Let me know if you have any other questions about this or if there is anything else I can do for you.

    Best
    Crisoforo

    #1418432
    besouro
    Participant

    could i do it from the database

    #1418449
    Crisoforo
    Keymaster

    Yes is something you can do as well but personally I don’t recommend as will bypass multiple WordPress filters and hooks that will detach other values / fields from the events so my suggestion will be use the bulk editor instead in order to run those automatically by WordPress as well.

    Let me know if there is anything else I can do for you.

    Best
    Crisoforo

    #1418524
    besouro
    Participant

    what table do the event reside in on the database? bc they are not deleting with bulk delete

    #1418526
    Crisoforo
    Keymaster

    They are stored under

     wp-posts

    But there are other fields that are stored on:

    wp-postmeta

    Make sure to clean your trash in order to remove the items completely. So this should be the right flow:

    Bulk Edit > Change status to draft > Remove all draft items > Remove trash

    All this can be done directly from the edit panel as noted on the answer on the other thread.

    Let me know if you have any other questions.

    Thanks,
    Crisoforo

    #1418527
    besouro
    Participant

    wont it be possible just to write a sql statement to just remove all hooks & post from database and if so could you help?

    #1418531
    besouro
    Participant

    couldn’t you just modify this SQL statement to delete all events?

    /*
    With events that were imported via iCal, when deleted the calendar still
    remembers them a bit so they don’t get reimported. This SQL Query will truly
    delete all those events.
    The query and steps below is modified version of that in this tutorial:

    How to bulk delete posts in WordPress with MySQL


    It is recommended that you read the source article above before proceeding.
    In particular it mentioned the importance of making backups before running
    SQL queries. 🙂
    */

    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_type = ‘deleted_event’

    #1418535
    Crisoforo
    Keymaster

    Hey!.

    You only need to change the type of the post you want to target in this case:

    WHERE a.post_type = ‘deleted_event’

    Into

    WHERE a.post_type = ‘tribe_events’

    Let me know if there is anything else I can do for you.

    Thanks,
    Crisoforo

    #1418541
    besouro
    Participant

    so then
    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_type = ‘tribe_events’

    #1418543
    besouro
    Participant

    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_type = ‘tribe_events’
    it got this error

    #1418555
    besouro
    Participant

    getting an error

    #1418559
    besouro
    Participant

    can you correct the statement so it works?

    #1418839
    besouro
    Participant

    CAN YOU ASSIST ME???
    I AM GETTING AN ERROR WHEN I TRY TO RUN THE STATEMENT.

    #1418970
    Crisoforo
    Keymaster

    Seems like you are having an issue with your quotes, make sure to use single quotes on:

    'tribe_events';

    So you get something like this at the end.

    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_type = 'tribe_events';

    Let me know if you have any other questions.

    Thanks,
    Crisoforo

Viewing 15 posts - 1 through 15 (of 17 total)
  • The topic ‘how do I remove all events from calendar’ is closed to new replies.