An hreflang tag also carries a media attribute
In the reportHreflang combined with media attribute
hreflang_link_with_media_attribute · Issue
This appears when a <link> tag carries both an hreflang and a media attribute. Google asks not to combine hreflang with other attributes such as media in one tag. Keep hreflang tags plain.
Severity: Medium. The tag does not follow Google's rule for hreflang; fix it when you next edit the template.
Why it matters
Google's guide to localized versions says not to combine hreflang annotations with other attributes such as media in a single <link> tag.
What to do
- Look at the finding: it shows each tag with both attributes, as written.
- Remove
mediafrom the hreflang tags. - If you also need a version for small screens, declare it in a separate tag without hreflang.
What we read
We read the <link rel="alternate" hreflang> tags in the page's HTML, anywhere in the markup, without running JavaScript. A page is reported when any of them also has a media attribute, whatever its value, even an empty one; a media parameter in a Link header is not read.
A page that answers 404 or 410, or returns a file other than HTML, is not applicable. A page is marked as not checked when its HTML could not be read in full, for example because it contains unsupported SVG markup, <noscript> or <select> element, answered with another error or no answer at all, or is over 2 MiB.
Example & evidence
Illustrative example — one tag, not a live audit.
https://bakery.example/en/ has:
<link rel="alternate" hreflang="fr" media="only screen and (max-width: 640px)" href="https://m.bakery.example/fr/">The tag combines hreflang and media, so the page is reported.
<link rel="alternate" hreflang="fr" href="https://bakery.example/fr/">A possible correction: a plain hreflang tag for the French version.
Confirm & check again
Check for yourself: view the page source and search the hreflang tags for media=.
Check again: Full audit — run a new audit of the site. The finding closes when the page is crawled again, its HTML read in full, and no hreflang tag has a media attribute.
Limits & sources
The check sees whether the attribute is there, not what the media condition says, and it does not see tags added by JavaScript.
Confidence: High because the tags are read directly.
Sources
- Google, Tell Google about localized versions of your page — says not to combine hreflang annotations with other attributes such as
mediain a single<link>tag. Checked 28 September 2026.
Editorial review: 29 October 2026