An article is published, both language versions are reachable, and the deployment has succeeded. I then want to know whether the connections between those pages are correct. For Automated Web, I use a dedicated SEO release check that reads the public sitemap, fetches the pages and writes any findings to a JSON report.
The workflow lives in my project as scripts/audit-live.mjs. It checks canonicals, hreflang, internal links, fragment targets, and the availability of images, scripts and stylesheets. Here is how it works, using a real audit run and the rules I set for this website.
The workflow at a glance
The sequence has six steps:
- Load the published website's sitemap.
- Fetch the HTML of each listed page.
- Compare metadata and language links across pages.
- Check internal destinations, fragment targets and embedded files.
- Group findings in a report and finish with an appropriate process exit code.
- After a clean check, submit the published URLs through a separate IndexNow step.
I run the audit after a deployment. When it finds a problem, I fix the affected part and run it again. The input comes from the public website, the same surface readers can access.
1. The sitemap defines the audit scope
The entry point is /sitemap.xml. The script extracts page addresses from the loc elements and also records the language alternatives listed alongside them.
I deliberately bounded the scope for Automated Web: a run may contain at most 200 sitemap URLs, and every address must belong to the supplied origin. An unexpected sitemap stops the run. This keeps the check within this project's scope.
The script fetches pages with a concurrency of six. Each request has a 30-second timeout, with up to three attempts for a network error. These are settings in my implementation and can be adjusted for a different workload.
The sitemap also defines a coverage limit. A page missing from both the sitemap and the internal links will not be discovered by this process. When publishing a new article, I therefore check that both language versions actually appear in the sitemap.
2. Each page gets its own findings
For each sitemap page, the script collects the HTTP status, H1 count, title, description, canonical, document language and hreflang links. It also checks indexing directives, image alt attributes, social preview images and whether the JSON-LD can be parsed as JSON.
I use proper parsers for both HTML and the sitemap. An example tag inside a comment, script or inactive template therefore does not count as a visible heading or a valid canonical. Malformed XML also fails the audit.
My project rules require exactly one H1, a self-referencing canonical, and a German or English document language. Unexpected noindex directives are reported. The audit also looks for duplicate titles and descriptions across the page set.
The code contains my own title and description length limits and a specific expected HSTS header. These are website rules I chose. Anyone adapting the script should change them to fit their own project.
The canonical is compared with the requested page address. For our separate language versions, each page should identify its own preferred URL. Google treats the canonical as a signal when choosing a representative page; this check alone cannot tell us which URL Google has selected. The underlying guidance is in Google's canonicalization documentation.
3. Hreflang is checked across connected pages
This is particularly useful for a bilingual website. The script evaluates a page together with its declared language alternatives.
German, English and x-default are required for this project. The checker also reports language references missing from both the HTML and the sitemap at the same time. Comparing the two lists alone would overlook that gap.
For each group, my implementation checks:
- Do the HTML language links match the sitemap entries?
- Does each page include a reference to its own language version?
- Are the alternative addresses absolute and present in the audit set?
- Do the targets return HTTP 200 without
noindex? - Does the document language match the declared language?
- Does the other version include the appropriate return link?
One example is the article pair about my EmDash MCP publishing workflow. If the German article points to the English version, but the English page points back to a different German address, the audit can report a missing return link or a mismatched language group. Checking each URL's availability in isolation would miss that relationship.
The script handles x-default separately as a fallback. The rules for self-references, complete URLs and reciprocal links follow Google's guidance on localized pages. Comparing the sitemap with the HTML is an additional project rule: I want those two outputs to stay consistent.
4. Internal links and fragments need their own checks
The script gathers internal links from the pages. It reuses documents already loaded and fetches additional internal destinations separately.
For a link containing a fragment such as #the-workflow-at-a-glance, a successful page response is only part of the check. The audit looks for a matching ID or named anchor in the target document. Renaming a section can therefore produce a broken-fragment finding even while the article continues to return HTTP 200.
Next come the embedded files: images, including srcset variants, image preloads, external script files and stylesheets. When an asset fails, the report includes the pages using it. That helps me identify a shared cause when the same file is missing in several places.
This includes social preview images, favicons and the icons listed in the manifest. I check the response's media type as well as its status: an image or script path returning an HTML page with HTTP 200 is a failure. I still check whether an image shows the intended subject in the browser.
The project also has fixed checks for items such as the robots file, sitemap, language feeds, manifest, selected security headers, the www redirect and the response for an intentionally missing page.
5. The report determines the next step
A documented reference run on November 22, 2026 contained these values in its summary section:
{
"sitemapUrls": 45,
"pages200": 45,
"hreflangLinks": 135,
"fragmentTargets": 355,
"failureCount": 0
}
This is a snapshot taken before the additional article pages being published here. The numbers grow as the website gains content.
Individual findings appear under failures, in categories such as pages, brokenLinks, brokenFragments, hreflang and brokenAssets. A hreflang finding also carries a label such as missing-return-link or sitemap-head-mismatch.
When findings exist, the script sets a failure exit code. An empty sitemap or an unsuccessful sitemap response also fails the run. A calling tool can use that result to detect that more work is needed and retain the JSON report as an audit artifact.
Running the check yourself
I have made the project-specific checker available as a JavaScript file. The documented run used Node.js 22.22.0. The download already includes its HTML and XML parsers, so this single file needs no package installation.
In the project, npm run audit:bundle regenerates the download from the source script. This step also runs automatically before the website build. With npm run test:audit, I check both the source and the download against prepared valid and deliberately faulty responses. Each negative case must report the appropriate error category; an unrelated crash does not pass the test.
Inside my project, I run:
node scripts/audit-live.mjs
With the downloaded file, the target URL can be supplied explicitly:
node automatedweb-live-audit.mjs https://automatedweb.net/
The terminal displays the JSON output. To use another website, adapt the project rules as well: languages, security headers, canonical expectations and fixed extra paths are specific to Automated Web. The script expects a URL sitemap; a larger website using sitemap indexes needs an expanded entry step.
6. IndexNow runs as a separate step
After a successful check, I use scripts/indexnow-submit.mjs. This second process also reads the sitemap and submits the published URLs to IndexNow in small batches. My setup uses five URLs per batch.
For the reference set, that meant nine batches covering 45 addresses. The responses were logged as HTTP 200. According to the IndexNow documentation, that status confirms receipt of the URLs. It does not promise whether or when a search engine will crawl or index a page.
The SEO checker itself sends no IndexNow notifications and publishes no content. I can repeat the audit without resubmitting URLs each time.
What I also check in the browser
This process examines the delivered HTML and HTTP responses. I add browser tests for search, keyboard focus, menus, viewport changes and small-screen presentation. For JSON-LD, the script checks JSON parsing; a semantic structured-data review is a separate task when needed.
Choosing the correct image also requires a visual check. A favicon file can be technically accessible while showing the wrong logo. This article's cover is an ImageGen illustration of the workflow, rather than a screenshot of an audit interface.
For me, the value of this workflow is its repeatability. After publication, the same concrete checks run across the website. The report identifies the page, connection or file that needs attention. I explain the preceding CMS publishing steps in my EmDash MCP workflow article.
