• Resolved paul509

    (@paul509)


    Getting this error in Webmaster Tools on the AMP section.

    “Accelerated Mobile Pages > User-authored JavaScript found on page”

    This is happening on every single post and nothing is getting indexed as AMP ready. I look at the source and dev tools console and the best i can tell it’s some kind of error in the google analytic scripts. I’ve tried disabling plugins but can’t narrow it down. The pages seem to display fine in AMP mode.

    Hosted on Hostgator…I read somewhere they may be causing this problem with AMP directly.

    Website is http://www.smartfem.com

    Quick link to a recent post in amp….

    http://www.smartfem.com/automotive/driving-2016-dodge-ram-1500-video/amp/

    I can’t find any posts from others having this problem. I would appreciate any ideas on how to get past this.

    https://wordpress.org/plugins/amp/

Viewing 10 replies - 1 through 10 (of 10 total)
  • 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 ?

    Thread Starter paul509

    (@paul509)

    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?

    Thread Starter paul509

    (@paul509)

    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!

    Thread Starter paul509

    (@paul509)

    So this is resolved….I checked and my pages are now starting to index properly as AMP in Webmaster Tools.

Viewing 10 replies - 1 through 10 (of 10 total)

The topic ‘Remove any custom JavaScript code from your page’ is closed to new replies.