How to Fix Broken AMP Pages and rel="amphtml" Link Errors

Your pages declare an AMP version with a <link rel="amphtml"> tag, but some of those AMP URLs return an error, a redirect or another non-200 response. By the end of this guide, every declared AMP URL will either load directly with a 200 status or the AMP tags will be removed and the old AMP URLs redirected to your normal pages.

By Updated ⏱ 30-60 minutes🎯 Intermediate● Low impactTechnical
Illustration: AMP / alternate version errors fix guide
TECHNICAL · FIX GUIDE AMP / alternate version errors IMPACTEFFORT TIME30-60 minutes LEVELIntermediate

Why it matters

A rel="amphtml" tag tells Google and other crawlers that a mobile alternate exists. When that URL is a 404, a 5xx or a redirect chain, crawlers waste requests on dead alternates, Search Console fills with AMP errors, and users arriving from AMP caches or old links can land on broken pages. Google stopped requiring AMP for Top Stories in 2021, so a broken AMP setup has costs and little benefit.

The impact on rankings is usually small, but fixing it is straightforward.

✕Beforehttps://example.com/blog/pricing-guide/has <link rel="amphtml"✓AfterEither the amphtml URLhttps://example.com/blog/pricing-guide/amp/returns 200 directly, or the amphtml

What you need

A list of your site URLs (sitemap or crawl export)
Terminal access with curl, or a crawler such as Screaming Frog
Access to your CMS, theme templates or server config
Google Search Console access (optional, for confirmation)

Step-by-step fix

1

List every page that declares an AMP version

">. In Screaming Frog, enable Config > Spider > Crawl > AMP and check the AMP tab, or use Custom Extraction with the XPath //link[@rel='amphtml']/@href. For a quick spot check, grep a single page with curl.

Record both the page URL and the href value.

text
curl -sL https://example.com/blog/pricing-guide/ | grep -io '<link[^>]*rel="amphtml"[^>]*>'
Pro tip: Relative hrefs such as "amp/" are resolved against the page's final URL after redirects, so a missing trailing slash on the parent page can change where the AMP link points.
2

Check the HTTP status of each AMP URL

Request each AMP URL without following redirects. Only a direct 200 counts as healthy. A 301, 302 or 308 is flagged even if it eventually reaches a working page.

Common causes:

  • Trailing-slash mismatch (/amp vs /amp/)
  • http:// in the href on an https site
  • AMP plugin or app removed, so the template still prints the tag but the route 404s
  • AMP endpoint throwing 500s or blocked by a firewall/bot rule
text
while read u; do printf '%s ' "$u"; curl -s -o /dev/null -w '%{http_code} %{redirect_url}\n' "$u"; done < amp-urls.txt
Pro tip: Use a normal browser User-Agent with -A if your WAF returns 403 to curl; otherwise you may chase a false error.
3

Decide whether to keep or retire AMP

Keep AMP only if it still brings measurable traffic. Check Search Console Performance > Search results, filter Search appearance > AMP results, and compare against the effort of maintaining two templates. If AMP traffic is negligible, retiring it is usually the better fix.

It removes the error class completely, and the check passes when no AMP versions are declared.

Pro tip: Core Web Vitals, not AMP, is what Google's page experience signals use, so a fast canonical page loses nothing by dropping AMP.
4

If keeping AMP: point hrefs at URLs that return 200

Make the amphtml href match the exact final URL of the AMP page: absolute, https, correct host (www or non-www) and correct trailing slash. Fix any AMP routes that 404 or 500, then run each fixed URL through the AMP validator so Google can still use it. Each AMP page must also keep its <link rel="canonical"> pointing back to the regular page.

html
<!-- Canonical page -->
<link rel="amphtml" href="https://example.com/blog/pricing-guide/amp/">

<!-- AMP page -->
<link rel="canonical" href="https://example.com/blog/pricing-guide/">
Pro tip: Only output the amphtml tag when the AMP version actually exists for that post type. Many sites print it on category or product pages that have no AMP template.
5

If retiring AMP: remove the tags, then redirect

First remove every <link rel="amphtml"> tag from templates, plugins or apps. Then add 301 redirects from the old AMP URLs to their canonical pages, so links, bookmarks and cached AMP URLs still land somewhere useful. Do it in this order: if you redirect while the tag is still present, the check keeps failing, because the declared URL now returns 301.

nginx
# Nginx: /any/path/amp/ or ?amp=1 -> canonical
location ~ ^(.*)/amp/?$ {
    return 301 $1/;
}
if ($arg_amp = "1") {
    return 301 $uri;
}
Pro tip: Apache equivalent: RewriteRule ^(.*)/amp/?$ /$1/ [R=301,L] in .htaccess.
6

Purge caches so the old head markup disappears

Clear your page cache (WP Rocket, LiteSpeed, Varnish) and CDN cache (for example, in Cloudflare go to Caching > Configuration > Purge Everything). Otherwise cached HTML can keep serving the old amphtml tags or old 404 responses for hours. Google's AMP Cache refreshes on its own once it sees the redirect or the updated page.

7

Re-test and confirm the result

Re-run the curl status loop from step 2 against your fixed list. Every remaining amphtml URL should return a bare 200 with no redirect_url. If you retired AMP, re-crawl and confirm that no page outputs a rel="amphtml" tag.

"

text
curl -sL https://example.com/blog/pricing-guide/ | grep -ic 'rel="amphtml"'
Pro tip: In Search Console, use **Experience > AMP > Validate fix** on any listed issue so Google recrawls sooner.

Platform-specific notes

WordPress

AMP tags usually come from the official AMP plugin, or from Yoast/Rank Math AMP integrations. To retire AMP, deactivate the plugin under **Plugins > Installed Plugins**, then check the theme's header.php or functions.php for hard-coded amphtml output. To keep it, review **AMP > Settings > Supported Templates** so tags are only printed for templates that render. Add /amp/ redirects with the Redirection plugin or at server level.

Shopify

Shopify has no native AMP. Tags come from apps (for example, AMP apps that serve pages under /a/ or /apps/ proxy paths) or from code pasted into theme.liquid. If you uninstall the app, the proxy route starts returning 404, so also delete leftover <link rel="amphtml"> code in **Online Store > Themes > Edit code > layout/theme.liquid**. Add redirects under **Content > Menus > URL Redirects** (in older admin versions: **Navigation > URL Redirects**).

Next.js

Next.js AMP support (export const config = { amp: 'hybrid' }) only ever applied to the Pages Router and has been deprecated and removed in recent major versions. When upgrading, delete the amp config and any manual amphtml tags in _document or the head component. Add permanent redirects for ?amp=1 or /amp paths in next.config.js using redirects().

Cloudflare

Cloudflare does not add amphtml tags itself, but a WAF or Bot Fight Mode rule can return 403 or a challenge on AMP paths, which counts as a failure. Check **Security > Events** for blocked /amp/ requests. You can implement the retire-AMP redirects with **Rules > Redirect Rules** instead of server config.

Wix / Squarespace / Webflow

Wix and Squarespace manage AMP (where offered, mainly for blog posts) through a site setting rather than code. Squarespace's toggle is under **Settings > Blogging > AMP**. Turning the toggle off removes the tags automatically. Webflow has no AMP output, so any amphtml tag comes from custom code in **Site settings > Custom code** or page-level head code, and you should remove it there.

Check that it worked

✅ How to verify

  • Run curl -s -o /dev/null -w '%{http_code}' on each declared AMP URL and confirm it prints 200, with no 301/302.
  • View the source of a sample of pages and confirm the amphtml href is absolute, https and matches the AMP page's final URL exactly. If you retired AMP, confirm the tag is gone.
  • Check Google Search Console **Experience > AMP** for falling error counts after validation.
  • Re-run the site audit and confirm the AMP check passes or reports that no AMP versions are declared.

⚠️ Common mistakes

  • Redirecting /amp/ URLs to canonical pages while the rel="amphtml" tag is still in the template, which turns a 404 error into a redirect error.
  • Uninstalling an AMP plugin or Shopify app but leaving hard-coded amphtml tags in the theme, so every page now points to a 404.
  • Using an href that differs from the real AMP URL only by trailing slash, protocol or www, which forces a redirect on every request.
  • Forgetting to purge the page cache or CDN, so crawlers keep seeing old head markup after the fix.

Is this still an issue on your site? Run a free audit — ZORO checks this and 294 other SEO, AI-visibility, accessibility and security signals, with fixes for your platform.

Check my site free

FAQ

Should I still use AMP in 2026?

For most sites, no. Google removed the AMP requirement for Top Stories in 2021, and ranking signals now rely on Core Web Vitals for all pages. Keep AMP only if Search Console shows it still drives meaningful traffic and you can maintain the templates.

Will removing AMP hurt my rankings?

Usually not. Google indexes your canonical page, not the AMP copy. If you remove the amphtml tags and 301-redirect the old AMP URLs, Google drops the AMP versions and shows your regular pages instead.

Why is my AMP URL flagged when it loads fine in the browser?

Browsers follow redirects silently. If the declared amphtml URL returns a 301 or 302 before reaching the AMP page (often due to a trailing slash or http to https), it is not a direct 200. Update the href to the final URL.

How long until Search Console stops showing AMP errors?

Typically a few days to a few weeks, depending on crawl frequency. Clicking **Validate fix** in the AMP report speeds it up. Errors for URLs that now redirect or no longer declare AMP age out of the report on their own.