Google AMP Disallowed javascript attribute in tag ‘amphtml engine v0.js script’ error [Solved]

I was surprised and worried to see the error today in my google webmasters tools for my website. The error said that it has caused google to delist my AMP pages from the search results. A huge set back obviously!

I’ll come straight to the point, and tell you how to fix it if you’re facing the similar issue.

Issue Start Date: 5th December 2018

Issue due to (apparently): Autoptimize wordpress plugin (coz they released their latest version on same date, plus the following fix in autoptimize settings solved the problem too.)

Also the error occurred in past too, but I didn’t use autopimize regularly on my site.

The error said:

Disallowed javascript attribute in tag ‘amphtml engine v0.js script’
First detected: 8/30/18

Status: Error

Solution:

Solution was fairly simple.

  1. Go to Autoptimize settings
  2. Add v0.js to the javascript Exclude scripts from Autoptimize list
  3. Save the settings
  4. Clear the cache
  5. Clear any other caches that are working on your site
  6. Re-test your url in google webmasters tools AMP section for errors

If you’re using any other plugin instead of autoptimize, it might be causing the issue too. Find its exclude js file settings and add v0.js there. Or disable the js magic (minification plugins usually try to defer or lazy load the javascript files on their own too, without giving much power to you to have control on the settings).

Please let me know if you’re having any issues and need help with them.

Leave a Reply

Your email address will not be published.