Bulk Delete The Events Calendar Events based on Event Date

Home Forums Bulk Delete Addons Scheduler for Deleting Posts by Post Type Bulk Delete The Events Calendar Events based on Event Date

We have replaced our forums with email based support system.

Please open a support ticket from our new support page.

This topic contains 6 replies, has 2 voices, and was last updated by  Sudar 6 years, 12 months ago.

  • Author
    Posts
  • #5885

    Aaron Riddle
    Participant

    Hi. I am looking to automatically delete events posted by The Events Calendar Pro 30 days after their event date has passed. I downloaded your plugin and purchased the scheduling option for post types.

    However, if I want to delete posts with the custom post type of “tribe_events” older than 30 days, it is going to remove the events based on the date they were published as as post. For example, an event occurring on March 1, 2016 may have been posted to the site on January 30, 2016…so it would be removed.

    Somehow I need to tell your plugin to target the event’s date and base the deletion scheduler per that field. Is that a meta field, or a custom field I should be targeting?

    Thank you for your help.

    Aaron Riddle

  • #5932

    Aaron Riddle
    Participant

    Hi. I have figured out that the custom fields I need to target old events are the “_EventEndDate” custom field for the “tribe_event” post type.

    I think I am on the right track, but still need some help. I am including two screenshots of the options the bulk delete plugin gives me. I know I need to select “tribe_events” as the post type, and am assuming “_EventEndDate” is the Key…however I am unsure what to place in the “Value” box or the “Enter Date Format” box.

    Screenshots:

    View post on imgur.com

    View post on imgur.com

    What are your thoughts? Thanks!

  • #5952

    Sudar
    Keymaster

    Hello Aaron,

    Yes, you are on right track.

    In the “Delete Posts by Custom Field” module, you have to enter the following information to delete events based on their end date.

    – Post Type – Select “tribe_events”
    – Key – _EventEndDate
    – Dropdown – less than (date)
    – Value – Date in this format YYYY-MM-DD (eg: 2016-02-23)
    – Date Format – Empty

    I have also attached a screenshot with these values.

    Please note that you need to have v0.8 of the “Bulk Delete Posts by Custom Field” addon. It was released just today.

    The earlier versions of the addon had some compatibility issue with “The Events Calendar” plugin.

    Let me know if you face any issues with it.

    Attachments:
    You must be logged in to view attached files.
  • #5956

    Aaron Riddle
    Participant

    Hi, Sudar.

    Thank you for this information! It helped me out a lot and appears to work perfectly.

    I do have one more question. I also have the “Delete Posts by Custom Field Scheduler” plugin. Is it possible to schedule deletions of these types? So if I wanted to schedule the plugin to delete event posts older than 30 days from the _EventEndDate key (not the published date), how would that be done?

  • #5957

    Sudar
    Keymaster

    Thank you for this information! It helped me out a lot and appears to work perfectly.

    Glad to know that you got it working.

    Is it possible to schedule deletions of these types?

    Yes. But there is one caveat.

    So if I wanted to schedule the plugin to delete event posts older than 30 days from the _EventEndDate key (not the published date), how would that be done?

    The caveat is that in the values textbox you have to enter a date and it can’t be calculated dynamically.

    Adding the ability to input the date dynamically might increase the complexity of this addon. I am planning to create a separate addon for “The Events Calendar” plugin itself with this feature.

    I will let you know once I release that addon.

  • #5966

    Aaron Riddle
    Participant

    Got it. Calculating the date dynamically is what I am looking for. I look forward to the future release of the Events Calendar addon plugin once you have that ready. It seems there is a strong demand for this feature and your plugin seems to provide that need.

  • #13281

    Sudar
    Keymaster

    Hello Aaron,

    Just a quick note to let you know that we just released v1.0.0 of Bulk Delete Posts by Custom Field add-on with the ability to specify dynamic or relative dates.

The forum ‘Scheduler for Deleting Posts by Post Type’ is closed to new topics and replies.