Title: Remove any custom JavaScript code from your page
Last modified: August 31, 2016

---

# Remove any custom JavaScript code from your page

 *  Resolved [paul509](https://wordpress.org/support/users/paul509/)
 * (@paul509)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/)
 * 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](http://www.smartfem.com)
 * Quick link to a recent post in amp….
 * [http://www.smartfem.com/automotive/driving-2016-dodge-ram-1500-video/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/](https://wordpress.org/plugins/amp/)

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

 *  [pandorino](https://wordpress.org/support/users/pandorino/)
 * (@pandorino)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430337)
 * 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
 *  [pandorino](https://wordpress.org/support/users/pandorino/)
 * (@pandorino)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430338)
 * 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.
 *  [pandorino](https://wordpress.org/support/users/pandorino/)
 * (@pandorino)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430339)
 * **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/](https://mywebsite.com/sample-post/)_
 * The [AMP plugin](https://es.wordpress.org/plugins/amp/) 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.
 *  [Peter](https://wordpress.org/support/users/petersnet/)
 * (@petersnet)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430365)
 * Thanks for the provided information. How can we check if this issue is resolved
   on the /amp/ page ?
 *  [pandorino](https://wordpress.org/support/users/pandorino/)
 * (@pandorino)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430366)
 * [@peter](https://wordpress.org/support/users/peter/)
 * Check out this link: [https://www.ampproject.org/docs/guides/validate.html](https://www.ampproject.org/docs/guides/validate.html)
 *  Thread Starter [paul509](https://wordpress.org/support/users/paul509/)
 * (@paul509)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430367)
 * 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.
 *  [shamirislam](https://wordpress.org/support/users/shamirislam/)
 * (@shamirislam)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430369)
 * [@paul509](https://wordpress.org/support/users/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](https://wordpress.org/support/users/paul509/)
 * (@paul509)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430370)
 * 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.
 *  [shamirislam](https://wordpress.org/support/users/shamirislam/)
 * (@shamirislam)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430372)
 * Thanks paul509, I’ll do that.
 * You’ve been a great help!
 *  Thread Starter [paul509](https://wordpress.org/support/users/paul509/)
 * (@paul509)
 * [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430374)
 * 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.

 * ![](https://ps.w.org/amp/assets/icon.svg?rev=2527602)
 * [AMP](https://wordpress.org/plugins/amp/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/amp/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/amp/)
 * [Active Topics](https://wordpress.org/support/plugin/amp/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/amp/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/amp/reviews/)

 * 10 replies
 * 4 participants
 * Last reply from: [paul509](https://wordpress.org/support/users/paul509/)
 * Last activity: [9 years, 11 months ago](https://wordpress.org/support/topic/remove-any-custom-javascript-code-from-your-page/#post-7430374)
 * Status: resolved