How do I delete nodes older than X days? Does anyone have a snippet for deleting nodes that are older than 1 day? I would like to run this on cron tasks.
I had problems with D7 using Auto Expire, and ended up using HOOK_cron() in a custom module:

function mymodule_cron() {

// we only want to deal with messages (a content type)
$message_type = "message";

// grab all messages
$message_nodes = node_load_multiple(array(), array('type' =&gt; $message_type));
// set up the timestamp for the expiry
$message_search_date = strtotime("- 30 days"); // UNIX timestamp for 30 days ago

// now loop through messages, &amp; if they are old, expire them
  foreach($message_nodes as $m) {

    $obj = entity_metadata_wrapper('node', $m);

    // when was it last updated, &amp; is it still published?
    $last_update = $obj-&gt;changed-&gt;value();
    $published = $obj-&gt;status-&gt;value();

    // if it's still published &amp; it's not recent, then unpublish it
    if(($message_search_date &gt; $last_update) &amp;&amp; $published&lt;&gt;0) {
        $obj-&gt;status = 0;
        $obj-&gt;save();
    }
  }
}