I have a classifieds site and would like to have a node expire after 45 days (unpublished), no matter how many times the user edits and saves the node. However after the node expires, the user has the ability to renew (publish) for another 45 days. I would like the time to be strictly 45 days with simple a renew button when it is expired.

Here is the workflow:

  1. User creates node
  2. Email is sent to node author indicating successful post.
  3. Node is automatically expired 45 days later.
  4. Email is sent to node author indicating expired post.
  5. User has the ability to easily renew ad (expiry date is 45 days later yet again)
  6. Email is sent to node author indicating renewed post (different from step 2)

I would also like to have a countdown for the days remaining until the expiry date.

I have successfully built steps 1-4 using rules only, however the rules are based on the event 'After saving new content', which means when a node is republished/renewed the rules do not follow because it is not new content.

I have also tried using the Scheduler module to set the unpublish date but cannot figure out how to enable renew only after it has expired.

I have also tried Auto Expire but I think it only gives the ability to renew before it expires, not after.

  • How the author renew the ad? Jun 11, 2013 at 9:05
  • Maybe the author can renew the add by clicking a button on the node edit page, or a renew URL link can be sent to the email address.
    – chrisck
    Jun 11, 2013 at 10:37
  • for simplicity it is better done in hook_cron. To expire, just unpublish it.
    – AgA
    Jun 14, 2013 at 5:48

3 Answers 3


I would have opted for a custom code solution with the above work-flow.As an alternate contrib module option classified Ads module can be potential option.

Module Features:

Renewable expired ads during the 'grace period' Simple taxonomy-based browsing Ad expiration depending on category selection Per-user classified ads lists – custom lists totally sortable Length-limited body text with live counter of characters Advanced Help, CCK, Context, Panels, Token and Views support


This is an idea/suggested code but not solution. Use node_save to re-publish node.

$node = node_load($nid);
// set status property to 1
$node->status = 1;
// re-save the node
  1. Create a button and display it in menu local task tab (along with node edit).
  2. Once the user clicked the "Renew" button it will trigger the custom function that contains something like monymirza's answer.

Make sure that the "Renew" button is only visible to node owner only.

function renewAd() {
  $node = node_load($nid);
  // set status property to 1
  $node->status = 1;
  // re-save the node

See this thread on how to get the nid from URL.

Get a node ID from the URL

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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