π¬ Audit stale WordPress posts and email refresh digests with Gmail
β‘ 0 views Β· π¬ Content Creation & Video
Description
Quick overview
This workflow runs monthly (or on demand) to find WordPress posts that havenβt been updated for a configured number of months, scores and ranks them by refresh priority, builds an HTML digest, and optionally emails the report via Gmail.
How it works
- Runs on the first day of every month at 09:00 (or starts manually).
- Reads configuration values like site URL, staleness cutoff, scan limit, and email settings.
- Calls the WordPress REST API to fetch published posts last modified before the cutoff date.
- Strips HTML to count words, detects mentions of older years, and assigns a High/Medium/Low refresh priority based on age and year mentions.
- Sorts posts by priority and age, then generates an HTML table digest and subject line summarizing the findings.
- If stale posts exist and email sending is enabled, sends the HTML digest to the configured recipient using Gmail; otherwise it outputs a result indicating email was skipped.
Setup
- Create a WordPress Application Password and add an HTTP Basic Auth credential in n8n, then select it for the WordPress REST API request.
- Update the Config values, including
siteUrl(no trailing slash),staleAfterMonths,postsToScan, andmaxRowsInReport. - Optional: add a Gmail credential, set
reportEmail, and setemailReportto true to enable sending the digest email.
π Nodes Used
HTTP Request, Gmail, Schedule Trigger
π₯ Import
Download workflow.json and import into n8n:
Workflow menu β Import from File