Quick overview
This workflow scans recent published WordPress posts for external links, checks each link with HTTP HEAD requests, and compiles an HTML report of broken links or links needing manual review, optionally sending the report via Gmail on a weekly schedule or manual run.
How it works
- Runs manually or every Monday at 9am.
- Fetches the latest published posts from the WordPress REST API using HTTP Basic Auth.
- Extracts external (non-site) URLs from each post’s HTML content and limits the run to a maximum number of links.
- Checks each extracted URL with batched HTTP HEAD requests using a configurable timeout.
- Classifies each link as ok, broken, or review based on the HTTP status code or request errors.
- Builds an HTML report summarizing totals and listing only broken or review links.
- Sends the report via Gmail when issues are found and email reporting is enabled, otherwise outputs the report data without emailing.
Setup
- Create a WordPress Application Password and configure an HTTP Basic Auth credential in n8n for your WordPress user.
- In the Config values, set your WordPress site URL, how many posts to scan, link limits, and the request timeout.
- (Optional) Add a Gmail credential, set the recipient email address, and enable emailReport to true to send the report automatically.