Monitoring a website’s health is crucial, but doing so manually is both time-consuming and prone to human error. To streamline this process, I built an automated website monitoring solution using n8n, which checks a live WordPress site daily and sends Slack alerts only when an issue is detected. This solution ensures that I can focus on resolving real issues, rather than sifting through false positives.
Building the Automated Website Monitoring Workflow
The workflow I created consists of 15 nodes and runs on a self-hosted n8n instance. Each morning, it performs a comprehensive site sweep to ensure everything is in order. The workflow is read-only, meaning it never writes to the site. The nodes are arranged in the following order:
Schedule Trigger -> Read State (Data Table, row get) -> Fetch Sitemap Index (HTTP Request) -> List Child Sitemaps (Code) -> Fetch Child Sitemaps (HTTP Request) -> List Page URLs (Code) -> Fetch Each Page (HTTP Request) -> Check Page (Code, run once for each item) -> Compute State (Code) -> Save State (Data Table, upsert) -> Build Report (Code) -> Any Issues? (If) -> Post Issues (Slack) or Post All Clear (Slack). The workflow checks various aspects of each page, such as HTTP status, content type, SEO elements, and more. The sitemap yields 88 HTML URLs, and each page-fetch request uses built-in batching with a size of 1 and a 700ms interval to avoid overloading the server.
Handling Errors Gracefully
To ensure the workflow doesn’t fail due to a single error, each HTTP Request node is configured to set fullResponse to true and neverError to true. This means that even if a page returns a 404 or 500 error, it is captured as data with a statusCode field, allowing the workflow to continue running smoothly.
Bug 1: 58 False Alerts from One Regex
Symptom
The FAQ accordion check reported links inside answer panels on 58 of the 88 pages. This was clearly implausible, as it suggested issues on two-thirds of the site.
Investigation
A DOMParser check was conducted on one page to count actual links within the FAQ panels. It found 5 real panel bodies but no links, confirming the alerts were false.
Cause
The regex was mistakenly counting the accordion control itself, which is an anchor element used to toggle the panel, not a link inside the answer.
Fix
The solution involved stripping the panel heading first and then ignoring any anchor with data-vc-accordion or whose href starts with a hash.
Result
The number of false alerts dropped from 58 to 0.
Bug 2: A Check That Would Have Fired Forever
Symptom
The brand misspelling check triggered on all 88 pages during every run, without exception.
Investigation
Upon examining a page’s source, the misspelling was found in the site logo file name and within comments in the Additional CSS section, not in visible text.
Cause
The check was examining the raw HTML rather than focusing on what visitors see.
Fix
I modified the check to build a visible-text string by removing script blocks, style blocks, HTML comments, and all tags. The check then ran against this string:
const visible = html
.replace(/ Result
The false alerts for brand misspelling dropped from 88 to 0. Additionally, this change resolved a false positive related to shortcode leaks.
Bug 3: A File That Is Not a Page
Symptom
The checks for missing title and meta description fired on a .kml map file.
Cause
The file appeared in the sitemap but wasn’t an HTML document, so it naturally lacked a title or meta description.
Fix
I filtered out non-HTML extensions when building the URL list and checked the content-type header before running page checks.
Result
The total number of URLs to be checked reduced from 89 to 88.
Conclusion
A monitor that cries wolf is worse than no monitor at all. Most of the build time was spent eliminating false positives rather than writing the checks themselves. An automated check that hasn’t been verified against the actual page is merely a guess with a progress bar.
Want This Built for You
If you’re looking to implement automated website monitoring or need help with AI Solutions and Automation, consider what can be achieved with n8n and Slack integration. Whether it’s ensuring your website’s health or streamlining notifications, the right automation can make all the difference.