Skip to content

Programatically check hreflangs at a given url using existing js test tooling

License

Notifications You must be signed in to change notification settings

bmpickford/hreflang-checker

Repository files navigation

hreflang-checker

Easily check your HTML hreflangs are valid in your end to end or integration suite. This package validates

  • Language codes are valid
  • All alternate pages have a 200 response
  • Hreflangs are biderectional
  • Hreflangs are self referencial
  • An x-default tag is present

For more information on hreflangs, see https://developers.google.com/search/docs/specialty/international/localized-versions#all-method-guidelines

Libraries

Testing library Link
Jest link
Mocha link
Playwright link
Cypress (WIP) link