Stay up to date with AI tools, model releases, and developer workflows that matter.
Recent findings suggest that weekly. Free. One click to leave.
7 Day Free Trial. Cancel Anytime.
According to recent reports, A missing canonical tag, an accidental noindex directive or a wrong redirect can hurt a page's search visibility before anyone notices. These errors often start in CMS templates, publishing settings or deployment configuration, and a periodic audit finds them only after publication. Developers can prevent many of them by putting validation rules into the publishing workflow.
It has been revealed that this tutorial builds a small JavaScript validation layer that checks page metadata, indexing directives, canonical URLs and rendered HTML before content goes live. The core is plain functions with no dependencies, so it can be adapted to WordPress, Strapi, Sanity, Contentful or a custom Next.js site. All the code below was run with Node.js 22, and the tests pass.
Not every SEO concern should prevent publication. Separate results into two groups:.
Sources indicate that the rules should reflect the site's architecture. Authentication pages, internal search results and some filtered URLs may intentionally use noindex, which is why the page object below carries an intendedForIndexing flag. For background on crawlability, canonicalization and site structure, see this technical SEO guide from NogenTech, SitePoint's technical SEO audit steps and Google's documentation, which is linked where relevant below.
A validation layer needs predictable input. Instead of reading values from individual CMS components, normalize page data into one shared object:.
Sources indicate that this object is the interface between the CMS and the validation engine. For a headless CMS, populate it from the content API. In a traditional CMS, extract the matching fields before saving or publishing. The validator should not care how the content is stored.
Recent findings suggest that the module below evaluates a page and returns structured results. It checks the title, slug, description and robots directives. Per Google's robots meta tag documentation, none is equivalent to noindex, nofollow, so the validator treats both as blocking when the page is meant to be indexed. It also includes the canonical and content-element checks covered in the next sections, a function that analyzes rendered output, and a publishing gate.
validateSEO returns a predictable shape that a CMS interface, API endpoint or deployment pipeline can consume: { valid, errors, warnings }. The 65-character title threshold is an editorial preference, not a Google ranking requirement, and search engines may show different title lengths depending on the query, device and available space.
Canonical tags signal a preferred URL when several pages contain duplicate or very similar content. Google's canonicalization documentation lists redirects and rel="canonical" annotations as strong signals and sitemap inclusion as a weaker one, and indicates Google still decides which pages are duplicates. In other words, a canonical tag is a strong preference, not a command. CMS-generated canonicals go wrong when content is migrated, slugs change or staging configuration reaches production, so validateCanonical checks for a missing value, a non-HTTPS URL, an unexpected hostname, a URL fragment and invalid syntax.
In a recent development, the example assumes an HTTPS-only site with approved hostnames. A site that syndicates content across domains needs explicit exceptions. Syntax checks are also not enough: the canonical destination should be checked for HTTP status, redirects and indexing eligibility, which needs a network request that the pure function does not make.
In a recent development, validateContentElements raises warnings, not errors. An empty alt="" attribute is correct for decorative images, so the function checks that the attribute exists instead of requiring descriptive text. A page with no internal links gets a review warning, because some landing pages and standalone resources do not need contextual links. Asynchronous checks for broken internal destinations, redirect chains and links to unpublished content can be added later.
A CMS can store correct metadata while the frontend renders something else. Layout components can override titles, multiple plugins can emit canonical tags and environment variables can introduce staging URLs. Playwright can collect what a browser actually sees:.
It has been revealed that analyzeRendered in the validator module then compares those results with the CMS data. It flags unexpected HTTP status, missing or multiple canonical tags, a canonical that differs from the CMS value, an indexing directive in a meta tag or an X-Robots-Tag header, and a title that does not match. Google documents X-Robots-Tag as an HTTP header that accepts the same rules as the robots meta tag, which is why a header can hide a noindex that never appears in the HTML.
According to recent reports, run these checks against preview deployments and production pages. For applications that inject metadata asynchronously, wait for the relevant rendering state before collecting results. A browser test complements, but does not replace, inspecting the initial HTML response, because that is what many crawlers receive first.
Structured data needs more than a check that a JSON-LD script exists. A valid JSON document can still contain wrong Schema properties, outdated prices or information that conflicts with the visible page. An Article schema might name an author who differs from the one shown on the page. A structured data check should cover:.
Recent findings suggest that treat it as an independent test component. SitePoint's guide to testing JSON-LD like an API covers additional checks for release testing. Passing validation does not guarantee that Google will show a rich result.
Technical validation highlights whether a page meets defined publishing requirements. It cannot tell whether an article is accurate, original or complete for its audience, and a page can pass every metadata check while containing outdated instructions. Editorial review should assess search intent alignment, factual accuracy and sources, original contributions, coverage of essential concepts, and author expertise.
It has been revealed that tooling for this stage varies from a manual checklist to dedicated software. One example is NogenTech Content Optimizer, which describes itself as reviewing a draft before publication and scoring it across dimensions such as search intent, entity coverage and information gain. Its page lists a free tier with three analyses and paid plans, and does not publish its scoring methodology or accuracy data, so treat its scores, like any vendor's, as input to an editor's judgment and test it on your own content before relying on it. A written editorial checklist is a legitimate alternative.
Industry observers note that keep editorial assessments separate from automated technical rules. Scores should inform revisions, not automatically approve or reject articles. The CMS can store editorial approval as its own publishing requirement without integrating any specific external tool, which is how the editorialStatus field works in the publishing gate.
Recent findings suggest that publishPage in the module runs the validation when an editor tries to publish. It returns blocked with the errors when validation fails, pending_review when the page is valid but not editorially approved, and calls cms.publish() only for approved pages. Here cms.publish() stands for the publishing method of your CMS adapter.
According to recent reports, A production implementation should enforce these checks on the server. Client-side validation improves the editing experience but can be bypassed with direct API requests. A workflow might run in this order:.
Store validation results with each content revision, so editors can see recurring complications and developers can investigate template-level failures.
Industry observers note that validation rules can fail too: an overly strict rule keeps legitimate pages from being published. The suite below uses Node.js's built-in test runner. It covers the valid page, blocked and intentional noindex, the warning versus error split, every canonical rule, alt handling, rendered-page analysis, the publishing gate, and a real browser test against a local server that returns two canonical tags and a noindex header.
In a recent development, save the modules as validator js and inspect mjs and the tests as validator test mjs Add { "type": "module" } to package json, then run node βtest In our run all nine tests passed with Node js 22. The browser test is skipped automatically when Playwright is not installed.
Add more cases for malformed URLs, missing fields, canonical exceptions, and CMS-specific publishing configurations, and run the suite in CI whenever validation rules or metadata templates change.
Sources indicate that an SEO validation layer moves technical quality checks from periodic audits into the publishing process. By separating blocking errors from warnings, inspecting rendered HTML, testing the rules and requiring independent editorial approval, developers can prevent recurring mistakes without restricting content teams unnecessarily. Start with metadata and indexing checks, then extend the validator to match your site's architecture and publishing requirements.
7 Day Free Trial. Cancel Anytime.
