0

I have a situation where future events will be posted to the website in question. These future events are a content type with a date field using the date module.

I wish to automatically delete these events once their date has past. I'm assuming that rules should do this but I have searched and I am struggling to find a way to do this.

  • 1
    Is it important to delete or would un publishing be ok. If so check the 'scheduler' module. – Deejay Jan 6 '15 at 6:37
0

You can use the hook_cron to solve your problem

function mymodule_cron(){
  _mymodule_delete_nodes();
}

function _mymodule_delete_nodes(){
  //select all nodes from type X where date expired
  //node_delete($nid);
}

See hook_cron for further information

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.