Amp-wp: AMP validation errors

Created on 10 Feb 2016  Â·  5Comments  Â·  Source: ampproject/amp-wp

Hi,
on my WordPress site with AMP 0.2 I get this error:

Powered by AMP ⚡ HTML – Version 1454976295735
validator.js:290 AMP validation had errors:Zu.error @ validator.js:290
validator.js:290 website/amp/:6:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value '//fonts.googleapis.com/css?family=Merriweather:400,400italic,700,700italic|Open+Sans:400,700,400italic,700italic'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#custom-fonts)Zu.error @ validator.js:290
validator.js:290 website/amp/:9:0 The attribute 'src' in tag 'amphtml engine v0.js script' is set to the invalid value '//cdn.ampproject.org/v0.js'. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#scrpt)Zu.error @ validator.js:290
validator.js:290 website/amp/:83:0 The attribute 'align' may not appear in tag 'p'.Zu.error @ validator.js:290
validator.js:290 website/amp/:85:0 The attribute 'align' may not appear in tag 'p'.Zu.error @ validator.js:290
validator.js:290 website/amp/:131:0 The attribute 'type' in tag 'script type=application/ld+json' is set to the invalid value 'text/javascript'.Zu.error @ validator.js:290
validator.js:290 website/amp/:131:0 The parent tag of tag 'script' is 'body', but it can only be 'head'.Zu.error @ validator.js:290
validator.js:290 website/amp/:137:7 The mandatory tag 'amphtml engine v0.js script' is missing or incorrect. (see https://github.com/ampproject/amphtml/blob/master/spec/amp-html-format.md#scrpt)Zu.error @ validator.js:290
Validation

Most helpful comment

If you are using the Cloudflare plugin for Wordpress, turn off the "HTTPS Protocol Rewriting" setting in the Cloudflare plugin. That fixed it for me.

All 5 comments

validator.js:290 website/amp/:6:0 The attribute 'href' in tag 'link rel=stylesheet for fonts' is set to the invalid value
validator.js:290 website/amp/:9:0 The attribute 'src' in tag 'amphtml engine v0.js script' is set to the invalid value

Looks like something (a plugin?) might be changing the scheme from https to // which is the cause of most of these issues.

validator.js:290 website/amp/:131:0 The attribute 'type' in tag 'script type=application/ld+json' is set to the invalid value 'text/javascript'.Zu.error @ validator.js:290
validator.js:290 website/amp/:131:0 The parent tag of tag 'script' is 'body', but it can only be 'head'.Zu.error @ validator.js:290

Similarly, something else may be injecting into or modifying the page output.

I have the same problem, have you solved?
Thank you

If you are using the Cloudflare plugin for Wordpress, turn off the "HTTPS Protocol Rewriting" setting in the Cloudflare plugin. That fixed it for me.

@jwheck I've turned off this setting but I'm still receiving the errors.

My errors specifically are:

validator.js:320 website/amp/:6:1 The attribute 'type' in tag 'script type=application/ld+json' is set to the invalid value 'text/javascript'.tx.error @ validator.js:320(anonymous function) @ validator.js:361f.ca @ validator.js:295Mw @ validator.js:299Hw @ validator.js:299Aw.vb @ validator.js:299xw @ validator.js:292

@jwheck thank you! This helped me solve the problem.

Was this page helpful?
0 / 5 - 0 ratings