Are you getting Custom JavaScript is not allowed error for your AMP pages? Watch this video to fix it. Google Search console was throwing an error for a few of my Blog pages. And I fixed it using the steps that I show in the video.

Google was not able to index my AMP pages for my Blog. The error was that some custom JavaScript and CSS were injected into the AMP pages. Upon investigation, I found out that W3 Total cache was injecting minified JS (JavaScript) and CSS (Cascading Style Sheets) links into the pages. 


Errors showing up in search console:
1. Custom JavaScript is not allowed
2. External stylesheets not supported, except for whitelisted font providers. 
How to fix it?
For W3 Total Cache you need to activate the AMP extension. This will remove all the custom JS and CSS from the AMP pages. Go to your site Admin Dashboard - Performance - Extensions and activate AMP. W3 Total Cache comes built-in with the extension. You just need to activate it.


What is AMP?
AMP (Accelerated Mobile Pages) is an initiative to make web pages faster and more compatible across different devices and browsers. It is lead by AMP Project
Google supports AMP Project and provides tools and guidance to integrate AMP web pages with Google tools such as Search and Analytics.