-
Notifications
You must be signed in to change notification settings - Fork 9.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[SEO Audits] Document has a valid hreflang code #3177
Comments
@rviscomi some questions:
Notes to self:
|
Let's skip URL validation and focus on the hreflang value.
Is this just the
Skip it
Let's keep this in sync with the
Anchors can also have hreflang attrs but let's leave that outside the scope of this audit for now. |
Sorry, I meant if we should check if website links to itself via |
Oh ok. Yeah this audit should only be concerned with the language values themselves. |
Guys, It's not all aligned with the HrefLang Google recommendation: https://support.google.com/webmasters/answer/189077?hl=en Eg. https://www.maxwellbaynes.com/fr/toutes-nos-proprietes shows a Light-House positive hreflang validation but this is not the case... probably it's okay because a We should only validate if there's a (
Examples of correct use:
Also... in case Light-House is also able to deal with HTTP headers, Hreflang infos can also be set by webmaster on it. Here's the HTTP Header format supported by Google: Ex.
|
@fbessonnat sorry your comment lost some of its markup so it's hard to read. Could you reformat it with code blocks? |
@rviscomi : done! (thx for the code block advice) |
Prior to the v3.0 release, Lighthouse didn't have a concept of applicability of audits, so we chose to positively pass the audit even if there were no hreflang attributes to validate. In the case of this page, there aren't any so we pass the audit. It would be more accurate if we showed the audit in the "not applicable" category. https://googlechrome.github.io/lighthouse/viewer/?gist=3b0850ab03d903417ed5a3b1059cd105 @fbessonnat would that address your concerns? |
@rviscomi : just to clarify, if there's a [link alternate hreflang], yes, we can a add a "Document has a valid alternate hreflang" on the "Not applicable" section (very good choice). |
@fbessonnat I'm actually suggesting the opposite: If I think you're looking at the "Not applicable" section as "audits that do not need my attention because they passed". We treat it as "audits that have no conclusive result because they do not apply to the current page". WDYT? |
@rviscomi : Yes, I didn't have the good "Not applicable" vision. So, yes, if no hreflang the "Not applicable" section is the right place. :) |
I have a
|
Audit group: Content best practices
Description: Document has a valid
hreflang
Failure description: Document does not have a valid
hreflang
({value...})
Help text: Allows crawlers to discover alternate translations of the page content. Read more in the Search Console Help page.
Success condition: Query selector
head > link[rel=alternate][hreflang]
doesn’t exist, or thehreflang
value passes aXe validation for each respective link tag.Notes
a[hreflang]
The text was updated successfully, but these errors were encountered: