AMP标签报错“Referenced AMP URL is not an AMP”求助
I’ve run into similar issues with Blogger’s dynamic template setup and Google’s AMP testing tools before—let’s walk through the most likely fixes for your scenario:
1. Fix Protocol Mismatches First
Looking at your example, the non-AMP page’s amphtml tag points to an http:// URL, but it’s possible your AMP site is actually served over https:// (many modern sites force HTTPS now). Google’s testing tool treats HTTP/HTTPS mismatches as invalid because the redirected URL might not match what’s referenced.
To fix this, update your JavaScript to enforce HTTPS in the AMP link:
var pageurl = '<data:blog.canonicalUrl/>'; // Replace www with m AND force HTTPS var amplinkUrl = pageurl.replace('www','m').replace('http://', 'https://'); var amplink = document.createElement("link"); amplink.href = amplinkUrl; amplink.rel = 'amphtml'; document.head.appendChild(amplink);
Also double-check that your AMP page’s canonical tag uses HTTPS to match, so both links are protocol-consistent.
2. Ditch Dynamic JavaScript for a Static AMPHTML Tag
Blogger’s template engine lets you generate the amphtml tag directly without JavaScript, which avoids any timing issues where Google’s crawler might read the page before your script runs.
Replace your entire script block with this static template tag:
<link rel="amphtml" expr:href="replace(data:blog.canonicalUrl, 'www', 'm')" />
This uses Blogger’s built-in expr syntax to dynamically swap www with m at render time, no JS required. Crawlers will see the tag immediately, eliminating any execution delays.
3. Check for Hidden Redirects on Your AMP URL
Even if the AMP page passes validation directly, the URL in your amphtml tag might redirect to another address (like HTTPS). Google’s testing tool can flag the original HTTP URL as invalid because it’s not the actual AMP content.
Test this by running a curl command on your AMP URL:
curl -I http://m.filmsbit.com/2019/03/ajay-devgns-de-de-pyaar-de-first-look.html
If you see a 301 Moved Permanently or 302 Found status, update your amphtml tag to use the final redirected URL (the HTTPS version) instead of the HTTP one.
4. Verify AMP Page Indexing Requirements Beyond Validation
The AMP validator checks technical compliance, but Google’s indexing tools have extra requirements:
- Ensure your AMP page has valid structured data (e.g., an
Articleschema) - Confirm your robots.txt file doesn’t block the AMP subdomain
- Check that the AMP page loads quickly and isn’t blocked by any security tools
For more details, submit the AMP URL to Google Search Console and look at the Indexing tab—this will show specific errors the testing tool might not surface.
5. Clear Blogger’s Cache and Re-Test
Blogger caches template changes and page content aggressively. Even if you’ve updated your code, the crawler might be seeing an old cached version.
Head to your Blogger dashboard → Settings → Other → Clear Cache, then re-submit your non-AMP page to the Google AMP Test tool to pull fresh content.
内容的提问来源于stack exchange,提问作者Md Rimon

