content_archiver
Features
This module would provide site administrators with a simple way to set an expiration date on content nodes. When the expiration date is reached, the module would automatically unpublish the content and optionally notify the content author.
This module addresses a common problem for sites with high content volume (e.g., news sites, blogs, or event listings) by automating content cleanup and preventing outdated information from lingering on the site.
Post-Installation
### 1. Add an Expiration Date Field
First, you need to add a dedicated field to your content types to store the expiration date.
* Navigate to **Structure** → **Content types**.
* Click **Manage fields** next to the desired content type (e.g., "Article" or "Page").
* Click **+ Add field**.
* Select **Date** or **Date and time** as the field type.
* Give it a machine name, such as **`field_expiration`**. Then, click **Save and continue**.
* On the next screen, you can configure the field's settings. Click **Save field settings** to proceed.
---
### 2. Expose the Field on the Content Form
Next, make sure the field is visible for content editors to use.
* While on the content type's page, click the **Manage form display** tab.
* Locate the field you just created (**`field_expiration`**) in the list.
* Ensure its widget is set to an appropriate date picker (e.g., "Date and time").
* Drag the field to your preferred position on the form.
* Click **Save**.
---
### 3. Configure the Content Archiver Module
Finally, tell your **Content Archiver** module which field to use for the expiration date.
* Go to **Administration** → **Configuration** → **Content** → **Content Archiver**.
* In the settings form, find the option for "Expiration field machine name."
* Enter the machine name of the date field you created (e.g., **`field_expiration`**).
* Click **Save configuration**.