This post solves the issue of amp boilerplate tags are malformed:
The mandatory text inside tag 'head > style[amp-boilerplate]' is missing or incorrect.
![](https://i1.wp.com/nabtron.com/wp-content/uploads/2019/04/amp-validation.jpg?fit=510%2C464&ssl=1)
Cause was:
YUI compressor (PHP) for CSS in w3 total cache (instead of default minify compressor).
![](https://i0.wp.com/nabtron.com/wp-content/uploads/2019/04/yui-compressor.jpg?resize=412%2C190&ssl=1)
Solution:
Change the compressor back to Minify (default), save settings and purge cache.
Explanation:
The boilerplate style in head section for amp page include should this code:
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript>
If it doesn’t then google webmasters tools gives an error.
The YUI compressor was removing this code for some reason, resulting in empty boilerplate style tag.