• Resolved occupygh

    (@occupygh)


    Hello,

    I have been using WP Super Cache for a while but i just realized it is affecting my AMP pages, leaving a warning on Google search console as “Custom JavaScript is not allowed in amp“.

    I disabled the cache plugin and the pages are now fine. I love the cache and wished this error can be addressed.

    Thanks

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

Viewing 9 replies - 1 through 9 (of 9 total)
  • Thread Starter occupygh

    (@occupygh)

    Hello, can i get any help please.

    Plugin Support Bruce (a11n)

    (@bruceallen)

    Happiness Engineer

    Hi @occupygh

    Thanks for reaching out. You can try the following steps to see if they help with the issue:

    1. Disable caching for AMP pages: WP Super Cache allows you to exclude certain pages or posts from caching. You can exclude your AMP pages from caching by adding the URL parameter for AMP pages to the “Rejected User Agents” field in the Advanced Settings tab of the plugin. The URL parameter for AMP pages is “?amp”.
    2. Use an AMP plugin: To ensure that your AMP pages are fully compliant with the AMP specifications, you can use an AMP plugin such as AMP for WP or the official AMP plugin by Automattic. These plugins are designed to work seamlessly with WordPress and should not interfere with the caching of your site.
    Thread Starter occupygh

    (@occupygh)

    Hello @bruceallen

    Thanks for the reply. I have “Disable caching for AMP pages” by following the instructions above, I hope that works for now.

    However, I will like for my AMP pages to be ‘cache’ as well.

    I am currently using AMP for WP plugin and had earlier reported the issue with them. According to the developers, the issue isn’t coming from their plugin. I had to disable the WP Super Cache to notice that was the issue.

    Can your outfit kindly include a fix to this issue in the next plugin update?

    I believe a thousand people are having the same issue as i am.

    thank you.

    Thread Starter occupygh

    (@occupygh)

    Hello,

    I “Disable caching for AMP pages”  by adding the URL parameter, “?amp”, for AMP pages to the “Rejected User Agents” field in the Advanced Settings tab of the plugin, but it still didn’t work.

    I will be glad if a fix is included in the next update for the plugin.

    Thank you.

    Plugin Contributor Mark (a11n)

    (@thingalon)

    Hi @occupygh,

    WP Super Cache does not add any custom JavaScript files to your site’s front-end. I can see two possible causes behind the issue you experienced:

    1. Another plugin added a script to your amp pages, which Super Cache included in its cache. When you deactivated Super Cache, it fixed the problem because your site was no longer serving a cached “incorrect” AMP page, or
    2. Your site was mixing up AMP pages with non-AMP pages, and serving the same content to both versions of the page.

    Testing possibility 1 is very easy: Simply re-enable WP Super Cache, and click the “Delete Cache” button on the “Easy” tab in WP Super Cache to clear out your cache. If the problem persists after doing this, then we are probably dealing with the second possibility.

    In order to fix the second possibility, can you please try checking the following settings:

    1. Make sure that “Tracking Parameters” under “Advanced” does not include amp,
    2. Add amp to the “Rejected URL Strings” setting under “Advanced” in a new line of its own.

    Finally, can you please visit the amp version of your page in your browser when WP Super Cache is enabled, to check whether it looks the same as your main site, or if it looks like a simplified version.

    Thread Starter occupygh

    (@occupygh)

    Hello,

    Thanks for the clarification, i will try all that you suggested and keep you updated.

    Regards.

    Thread Starter occupygh

    (@occupygh)

    I will have to disable every plugin to find out which one exactly is adding the error. I plan on doing that later but a quick fix did work.

    I added amp to the “Rejected URL Strings” and that did make a fix for now.

    Also, my site isn’t mixing up AMP pages with non-AMP pages.

    The first possibility test didn’t solve the issue as well.

    My only permanent fix will be to disable my plugins one by one to find out which one is adding the custom error.

    Thanks for the assistance so far. Regards.

    Plugin Support Paulina H. (a11n)

    (@pehaa)

    Hey @occupygh

    I added amp to the “Rejected URL Strings” and that did make a fix for now.

    I am glad that this fix worked for you.

    I will have to disable every plugin to find out which one exactly is adding the error. I plan on doing that later but a quick fix did work.

    Please share the result of the test once you are ready.

    Thank you!

    Plugin Support Stef (a11n)

    (@erania-pinnera)

    Hi there, @occupygh,

    It’s been one week since this topic was last updated. I’m going to mark this thread as solved. If you have any further questions or need more help, you’re welcome to open another thread here. Cheers!

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Custom JavaScript is not allowed in amp’ is closed to new replies.