AMP HTML Link Tag on Pages With AMP Versions
Issue No: 134
Category: Link Rel Tags Issue type: Warning Priority: STANDARD
Description
Pages that have an Accelerated Mobile Pages (AMP) counterpart should declare a <link rel="amphtml"> tag in the canonical page <head> pointing to the AMP version, so that search engines can discover and serve the faster mobile variant in applicable search contexts.
How do we capture it
Inside HTML <head> on the canonical (non-AMP) page:
<link rel="amphtml" href="https://example.com/article/?amp=1">
The AMP page itself should contain a corresponding canonical back-reference:
<!-- On the AMP page -->
<link rel="canonical" href="https://example.com/article/">
- Issues an HTTP GET to the target URL.
- Reads raw response bytes without JavaScript execution.
- Scans the
<head>block for all<link>tags. - Searches for a tag where
relequalsamphtml. - Extracts the
hrefattribute value. - Issues a secondary HTTP GET to the AMP
hrefURL. - Records the HTTP status code of the AMP page response.
- Checks whether the AMP
hrefis a valid absolute URL.
The crawler validates:
- Whether a
<link rel="amphtml">tag exists in the head. - Whether the
hrefis a valid, non-empty absolute URL. - Whether the AMP page URL returns HTTP 200.
What to store
| Field | Type | Comment |
|---|---|---|
has_amphtml_link | BOOLEAN | Whether an amphtml link tag is declared in the page head |
amphtml_href | TEXT | The href value of the amphtml link tag |
amphtml_href_status | INT | HTTP status code returned when fetching the AMP page URL |
amphtml_is_absolute_url | BOOLEAN | Whether the amphtml href is a valid absolute URL |
Condition for trigger
The following trigger rules evaluate AMP HTML link tag validity and reachability.
-
Trigger Rule 1: Missing AMP HTML Link Tag
- Target Field:
has_amphtml_link - Evaluation Logic:
= FALSE - Severity: SUGGESTION
- Diagnostic Message: "No AMP counterpart link tag was found. If this page has an AMP version, add a
<link rel='amphtml'>tag so search engines can discover and serve the faster mobile variant."
- Target Field:
-
Trigger Rule 2: AMP Page URL Not Reachable
- Target Field:
amphtml_href_status - Evaluation Logic:
NOT IN (200, 201, 204) - Severity: WARNING
- Diagnostic Message: "The declared AMP page URL does not return a valid HTTP response. Search engines cannot access the AMP version and will fall back to the canonical page."
- Target Field:
-
Trigger Rule 3: AMP href Is Not an Absolute URL
- Target Field:
amphtml_is_absolute_url - Evaluation Logic:
= FALSE - Severity: STANDARD
- Diagnostic Message: "The amphtml href value is not an absolute URL. Google requires the amphtml href to be a fully qualified URL including scheme and domain."
- Target Field:
Sources
- Google Search Central — AMP on Google Search
- AMP Project — Linking canonical pages to AMP
- Google Search Central — AMP pairing guidelines
- MDN — link element rel attribute
- AMP Project Validator
Long description
AMP (Accelerated Mobile Pages) is an open-source framework that creates stripped-down, fast-loading versions of web pages optimized for mobile delivery by Google's cache infrastructure. When a site has both a canonical page and an AMP version, the two pages must be linked to each other so search engines understand their relationship.
On the canonical page:
<link rel="amphtml" href="https://example.com/article/?amp=1">
On the AMP page (back-reference):
<link rel="canonical" href="https://example.com/article/">
This pairing tells Google:
- The canonical is the full-featured version.
- The AMP URL is the mobile-optimized counterpart.
- Both represent the same content.
Without the amphtml link:
- Google may not discover the AMP version during crawling.
- The AMP page may not appear in AMP-eligible search results (Top Stories carousel, AMP badge).
- Content freshness signals between canonical and AMP versions may diverge.
Without the canonical back-reference on the AMP page:
- Google may treat the AMP and canonical pages as duplicate content.
- AMP page may be indexed independently without connecting to the canonical.
Common failure scenarios:
- amphtml link missing on canonical page: The AMP page exists but the canonical page never declares the
<link rel="amphtml">tag. Search engines cannot discover the AMP version through HTML inspection alone. - AMP URL returns 404: The tag is present but the AMP page was deleted or moved, causing the HTTP fetch to return a non-2xx status code.
- Relative URL instead of absolute: The
amphtmlhref uses a root-relative path instead of a fully qualified absolute URL. Google's AMP guidelines require the href to include scheme and domain. - AMP page blocked by robots.txt: The AMP URL exists and returns 200 but is blocked by
Disallowrules inrobots.txt, preventing search engines from crawling it.
How to Fix
Add the AMP link tag to the canonical page <head>:
<link rel="amphtml" href="https://example.com/article/?amp=1">
And ensure the AMP page links back to the canonical:
<!-- On the AMP page -->
<link rel="canonical" href="https://example.com/article/">
Requirements:
- The
amphtmlhref must be a fully qualified absolute URL (includinghttps://). - The AMP page URL must return HTTP 200.
- The AMP page must not be blocked by
robots.txt. - If the AMP version no longer exists, remove the
<link rel="amphtml">tag from the canonical page entirely.