• Resolved zelldi

    (@zelldi)


    Hello guys,

    since May 6th, my site’s AMP pages indexed by Google Search Console have been decreasing, and currently only 2 AMP pages are correctly indexed, while 96 have “serious problems”. How can I solve this?
    Seems like this is caused by a “custom javascript”, but I didn’t make any changes recently. All I am using for generating AMP pages is “AMP” plugin + “Glue for Yoast SEO & AMP”.

    What is weird, is that if I test any page with Search Console, I get a “Valid AMP Page” message; but if I test the same page at “https://validator.ampproject.org/”, I get “Custom Javascript is not allowed” on line 31, column 13″, which is this portion of text:

    <script>
                    if (document.location.protocol != "https:") {
                        document.location = document.URL.replace(/^http:/i, "https:");
                    }
    </script>

    Should I get rid of this code? And if yes, how?
    Thank you very much in advance.

    Stefano

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

Viewing 3 replies - 1 through 3 (of 3 total)
  • Hi @zelldi,
    Thanks for your patience. Could you please share a URL of a post that has a validation issue?

    Yes, please remove the custom JavaScript. It’s not allowed in AMP.

    Thread Starter zelldi

    (@zelldi)

    Hello,
    seems like I have solved the problem thanks to another user.
    I am using a plugin called “Really simple SSL”, and I had to turn off an option called “Enable javascript redirection to SSL”. Since I have done that, the AMP pages that are correctly indexed by Google Search Console have been increasing.

    Thank you anyway!

    Stefano

    Thanks, Stefano!
    It’s great that the issue is solved.

    It also helps that you shared the solution here. I think it’ll help resolve another issue.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Valid AMP pages on Search Console have been decreasing in the past two weeks’ is closed to new replies.