• All of my pages are AMP validated in the official AMP plugin on my WordPress website. They test as good…

    BUT

    In my Google Search Console, it shows they are invalid with this error message:

    Only amp-boilerplate and amp-custom ‘style’ tags are allowed, and only in the document head.

    So are they AMP active? Or are they not? I am confused.

    I put a bunch of work into being AMP compliant, so I hope this is not a big issue to resolve. Thanks!

    The page I need help with: [log in to see the link]

Viewing 11 replies - 1 through 11 (of 11 total)
  • Plugin Author Weston Ruter

    (@westonruter)

    Please share the specific URL to an AMP page that has the problem.

    Thread Starter zizicloud

    (@zizicloud)

    My URL is maximumoffgrid.com and now all my pages show an error on Google Search Console, but they still show as good on my AMP plugin.

    Plugin Author Weston Ruter

    (@westonruter)

    OK, I see you have an AMP-first site. Good.

    The validation error is due to this style being injected:

    <style type="text/css">@font-face {
      font-family: 'Liu Jian Mao Cao';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: local('Liu Jian Mao Cao Regular'), local('LiuJianMaoCao-Regular'), url(https://fonts.gstatic.com/s/liujianmaocao/v5/845DNN84HJrccNonurqXILGpvCOoTe3fLA.ttf) format('truetype');
    }
    @font-face {
      font-family: 'Roboto';
      font-style: normal;
      font-weight: 400;
      font-display: swap;
      src: local('Roboto'), local('Roboto-Regular'), url(https://fonts.gstatic.com/s/roboto/v20/KFOmCnqEu92Fr1Mu4mxP.ttf) format('truetype');
    }
    @font-face {
      font-family: 'Roboto';
      font-style: normal;
      font-weight: 700;
      font-display: swap;
      src: local('Roboto Bold'), local('Roboto-Bold'), url(https://fonts.gstatic.com/s/roboto/v20/KFOlCnqEu92Fr1MmWUlfBBc9.ttf) format('truetype');
    }
    </style>

    I’m surprised this is happening. Normally any such style elements are processed and merged into the amp-custom stylesheet. If I try adding it to a template, it gets merged into amp-custom as expected. Apparently this is getting injected after AMP plugin does post-processing. Can you identify where this font is coming from?

    Thread Starter zizicloud

    (@zizicloud)

    I see. Those are Google fonts but not entirely sure why they would be loading funny. When I get home tonight I will check it out. Could be a plugin or I will switch over to standard fonts. Thanks!

    Thread Starter zizicloud

    (@zizicloud)

    So I updated all my fonts to system fonts. I did not have any plugins specifically for fonts installed. I cleared my cache.

    I am using Astra theme, which claims they are AMP compatible. I was able to pass validation in Google Search Console for a couple of weeks, then the error occurred.

    I still am getting the error in Google Search Console. Any ideas as to why this is still persisting?

    Thread Starter zizicloud

    (@zizicloud)

    Is there some code I can input to fix the problem?

    Plugin Author Weston Ruter

    (@westonruter)

    Please search the source code for the themes and plugins for @font-face or gstatic perhaps, specifically in PHP files. You may need to download them via SFTP to easily do that.

    Then let me know which theme/plugin comes up.

    Alternatively, try deactivating plugins one by one to see if that style goes away, or try switching the theme to see if that makes it go away. Basically need to isolate which theme/plugin is responsible. Once that is identified, then we can see what code is responsible, and the issue can either be fixed or a workaround could be put in place.

    Thread Starter zizicloud

    (@zizicloud)

    SO this is a curious result. I actually disabled AMP plugin and Google Search Console went from “invalid” to “pending”. So it is going to crawl the pages and give me a result “in a few days”.

    Not sure how all that will work out but it is a bit strange! What do you think?

    @zizicloud I currently see you’ve re-activated the plugin and the validation error mentioned regarding the style element is still being flagged making the page invalid AMP. You can use the AMP Test tool to see the error as well: https://search.google.com/test/amp?id=k68vaVOFQG6Xn_jrlO4GOQ

    We’ll need to find the plugin or theme that is adding those styles. Did you get a chance to check if your theme or a plugin could be responsible?

    In terms of Search Console, if you’ve completely disabled the plugin, the pages are no longer processed by the plugin which changes their source code content. This could have set them for re-evaluation.

    Thread Starter zizicloud

    (@zizicloud)

    Sorry I haven’t gotten back to this issue sooner. I work 60 hour weeks and with the virus crisis, I have been a bit busy.

    So I isolated my issue to the plugin SG Optimizer. I am suspecting that SG Optimizer is not compatible with AMP.

    I believe this to be the issue because I was also having issues getting AMP to validate with the plugin, AMP for WP.

    Once I disabled SG Optimizer, I was able to get both the official AMP and the AMP for WP to work and get my AMP validated through Webmaster Tools.

    @zizicloud thanks so much for the update on your findings. We’ll look into it further. I wish you all the best. Stay well!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘AMP Validation in WordPress but not in Google Search Console’ is closed to new replies.