Extra Block Types (EBT) - New Layout Builder experience❗

Extra Block Types (EBT) - styled, customizable block types: Slideshows, Tabs, Cards, Accordions and many others. Built-in settings for background, DOM Box, javascript plugins. Experience the future of layout building today.

Demo EBT modules Download EBT modules

❗Extra Paragraph Types (EPT) - New Paragraphs experience

Extra Paragraph Types (EPT) - analogical paragraph based set of modules.

Demo EPT modules Download EPT modules

Scroll

Drupal node expire and auto expire removal of ads from publications upon expiration

17/04/2025, by Ivan

One essential feature of our Drupal classifieds board will be the automatic unpublishing of listings after a certain period. We'll start by using ready-made modules, and later we'll try implementing this functionality with the Rules module. For this, I found 2 modules for Drupal 6 and 1 for Drupal 7:

  • Node expire – Drupal 6
  • Auto expire – Drupal 6 and 7

Drupal 6 Node Expire

First, let’s try Node Expire for Drupal 6:
http://drupal.org/project/node_expire
I’ll use version 2.06.
Install and enable the Node Expire module.

Drupal Node Expire

This module also requires the Drupal Rules module.

Drupal Node Expire module

Now we can manage expiration times per content type. Let’s go to edit the content type "Ad":

Drupal Node Expire settings

Here we can specify how long nodes will remain published on the board. Let’s set it to 1 week. Use the following expressions to define dates:

  • +1 hour, +2 hours, +n hours
  • +1 day, +2 days, +n days
  • +1 week, +2 weeks, +n weeks
  • +1 month, +2 months, +n months
  • +1 month 2 weeks 3 days 3 hours

Let’s try using “1 week”.

Node Expire date

Now let’s create a node of the "Ad" content type:

Expiration date set

You’ll see an expiration date appear — exactly one week from the current date (today is 2011-12-02).

The module’s readme.txt file contains an importable Rules rule.

Drupal Rules

Paste the code from readme.txt into the import window:

Drupal Rules import

You’ll now see a new rule which you can edit in the admin UI to filter by content type or change the expiration date logic.

Drupal rule

Don’t forget to configure cron to ensure expired ads are unpublished.

Drupal 7 Auto Expire

Drupal Auto Expire

Download and install the Auto Expire module.

This module doesn’t require any dependencies, so you can use it immediately. Just configure permissions if you want other roles to edit expiration settings.

Drupal permissions

Go to site configuration and choose Auto Expire:

Drupal Auto Expire settings

Let’s go through Auto Expire settings:

Drupal Auto Expire content types

  • Article – basic Drupal content type (you can choose others).
  • Expire – enables expiration functionality for this content type.
  • Days – number of days the content remains published.
  • Warn – days before expiration to send a notification to the author.
  • Purge – days after expiration to permanently delete the node.

Note: As of 2011-12-07, Auto Expire is still in development and not yet production-ready.

Set your values, configure cron, and your ads will automatically unpublish on time.

In the next lesson, we’ll build similar functionality using the Rules module.