Same here, Google seems to suggest to remove all the <script> tags but I can’t, my theme works with some of them.
Any idea?
Thanks in advance
Edit
Seems my problem is related to some minified files.
<script async="" type="text/javascript" src="https://www.mywebsite.com/wp-content/cache/minify/000000/3c457/default.include-footer.df9a0d.js"></script>
I use W3 Total Cache plugin for minification.
Seems like I solved (still waiting Google to display the AMP pages in the search results, anyway from console there are no error but one message that says:”Powered by AMP ⚡ HTML”)
My solution was to go in W3 Total Cache > Minify > Advanced > Never minify the following pages and type /amp/ in the text area.
NOTICE: My permalinks are set as “Post Name” so they look like a folder sequence https://mywebsite.com/sample-post/
The AMP plugin by default just add the text /amp/ to the post link, so now every link ending by /amp/ are not minified by W3 Total Cache.
Not a big deal as an AMP page is supposed to be quite small anyway.
Hope this will help.
Thanks for the provided information. How can we check if this issue is resolved on the /amp/ page ?
Here is the specific line that seems to be giving me trouble….
<script src=’/google_analytics_auto.js’></script></head>
This is the only instance of Google analytics I can see on the AMP page
Edit….just found what caused this….it was anayltics integration in the CP of the server…went in there and turned it off…now it’s gone. Hopefully this solves the issue.
Just annoyed at the time I wasted trying to hunt down an error that was ultimately so far into the backend I had to go into the server CP to fix it.
@paul509, I’m having the same problem.
What exactly did you do to solve it again? Could your please explain in detail?
I haven’t seen the results of index yet…that will take a few days, but the dev tools shows AMP validation successful.
If you don’t have access to the CP (Control Panel) of the server, you need to contact the server admin or customer support and have them remove any Google Analytics from the server CP. If you do have access you can log in and find the analytics tools and uninstall it. This has nothing to do with WordPress, it’s at the server level.
Thanks paul509, I’ll do that.
You’ve been a great help!
So this is resolved….I checked and my pages are now starting to index properly as AMP in Webmaster Tools.