User-authored JavaScript found on page
-
Hello, I am having issues with several of my AMP pages. Google Search Console reported that these pages contain user-authored Javascript and the problem only came up two days ago.
I have tested some of these pages with AMP validator and Google AMP test. Both reported that those pages are valid.
May I seek some assistance on this?
Thank you!
The page I need help with: [log in to see the link]
-
Hello @nckai
I have checked the URL which you have shared but there is no validation error.
But as you are saying the GSC showing the error can you please exact URL where the error is showing in GSC so I can check it.
Hello @ampforwp! The URL I provided is one of those reported by GSC. Here’s another two with the similar issue.
https://www.misstamchiak.com/forbidden-duck/amp/
https://www.misstamchiak.com/meet-4-meat/amp/Thank you!
Hello @nckai
I have checked these URL as well but there are no validation errors.
I have tested the URL on Google amp test too but its also showing valid page.
Can you please wait 2,3 days so google can recrawl the pages again.
Hello @ampforwp! Sure! I was wondering if recent updates broke something, causing these issues to appear. Prior to that, everything was okay.
Hello @ampforwp, I think I might have found out what’s causing the issue.
I am using Really Simple SSL plugin and this line is embedded into the AMP pages.
<script>if (document.location.protocol != “https:”) {document.location = document.URL.replace(/^http:/i, “https:”);}</script><script type=’text/javascript’ async src=’https://cdn.ampproject.org/v0.js’></script>
Any workaround?
Hello @nckai
had you deactivated the SSL plugin? because there is no validations error on your page.
Please let me know.
Hello @ampforwp, this is the page where I discovered the error.
Hello @nckai
Can you please check this URL on the validator using the amp validator because there is no error found.
you can use this link to test the page.
Hello @ampforwp, it should be okay now cos I fixed it with the solution found here:
https://ww.wp.xz.cn/support/topic/critical-error-custom-javascript-is-not-allowed/
My AMP Validator Chrome plugin detected the error but it is now cleared after I applied the fix. I am trying to find if there are other affected pages.
Just to share, I had 300+ pages with the issue when I made my first post here. Now, it has increased to over 800 pages.
Hello
I too am still having issues with javascript:
User-authored JavaScript found on page (Critical issue)
Example:
https://my24-7restoration.com/water-damage-laguna-hills-ca/amp/I am having the same issue with site. I am using Really Simple SSL plugin for which they have now added a javascript redirect option. However, even though google says my errored pages are eligible for amp the AMP validator is giving me javascript errors.
Obviously all my once visible AMP are no longer showing on mobile serps.
-
This reply was modified 7 years, 12 months ago by
My247restore.
Nevermind,
I figured out what my issue was. My Hosting provider is GoDaddy
They were hiding a monitoring script that was not getting along with AMP.
<script>’undefined’=== typeof _trfq || (window._trfq = []);’undefined’=== typeof _trfd && (window._trfd=[]),_trfd.push({‘tccl.baseHost’:’secureserver.net’}),_trfd.push({‘ap’:’cpsh’},{‘server’:’p3plcpnl1022′}) // Monitoring performance to make your website faster. If you want to opt-out, please contact web hosting support.</script><script src=’https://img1.wsimg.com/tcc/tcc_l.combined.1.0.6.min.js’></script>
The Fix for GoDaddy folks is to go to gateway.godaddy.com.
Next to your “cPanel Admin” button there are the three dots, click the dots and click “Help Us”
Choose “Opt Out”
Done.
This at least fixed java issues for just “AMP” validation.
Lets see how google reacts.
Hello @ampforwp
All of the sites I manage are reporting “User-authored JavaScript found on page” in their GSC since early May. Here are some links
https://fluxandformcustomjewellery.com/sapphire-engagement-rings/amp/
https://leckerslaw.com/social-media-rules-for-workplaces/amp/
https://equityoutplacementservices.com/independent-contractor/amp/
https://yorkcounselling.ca/co-signing-loans/amp/When I test the pages no errors are detected. Can you assist with troubleshooting this?
Hello @seemapabari, seems like you are having the same issue as me. I assume you are using Really Simple SSL plugin as well? Try out the solution in the link I provided above. That should help.
hello @seemapabari
Are you using the latest version of our plugin?[0.9.94]
If you are using Really Simple SSL plugin then deactivate the check if the issue persists or not.
Just an update, after the fix, GSC reported that the pages with issue had dropped.
-
This reply was modified 7 years, 12 months ago by
The topic ‘User-authored JavaScript found on page’ is closed to new replies.