{
  "id": 17368793,
  "title": "Checking hreflang on a bilingual static site with a 35-line Node script",
  "url": "https://urgent.news/2026/10/31/checking-hreflang-on-a-bilingual-static-site-with-a-35-line-node",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-31T08:32:26.000Z",
  "source": {
    "name": "Dev.to",
    "slug": "dev-to",
    "url": "https://dev.to/manish_singh_283b806ee654/checking-hreflang-on-a-bilingual-static-site-with-a-35-line-node-script-2o19"
  },
  "original_language": "en",
  "account": "A bilingual static website has two language versions, English at the root and Hindi at /hi/. Most pages exist in both languages, but hreflang tags were treated as something to paste once and forget. The author wrote a checker script to ensure the hreflang tags are consistent and correctly implemented, rather than relying on the build script. The hreflang contract requires reciprocal links: if the English page points to the Hindi page, the Hindi page must also point back to the English page and list itself. The script checks for missing trailing slashes, self-reference, and return links. It confirmed that all 76 pages with hreflang passed the checks. The language switcher includes the same attributes for accessibility. The author plans to test the script further by intentionally breaking a page and verifying it gets flagged.",
  "summary": "My pension calculator has two language versions, English at / and Hindi at /hi/ , and most pages exist twice. I had always treated hreflang as a tag you paste once and forget. The problem is that it fails silently: nothing breaks in the browser, and search engines simply ignore alternate tags that don't agree with each other. So today I wrote a checker instead of trusting my build script. What…",
  "key_points": [
    "Checker script verifies hreflang consistency for bilingual static site",
    "Script ensures reciprocal links between English and Hindi versions",
    "76 pages with hreflang tags pass the script's tests"
  ],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 1,
    "also_reported_by": []
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}