W3TC not valid for AMP
-
Hi,
I am working on a website which is full AMP. So all the pages and posts are AMP enabled. I am using the official AMP plugin for this. Everything works fine but there is one invalid script tag generated by W3TC. I did install the AMP extension but this does not seem to be usable in my situation, since I am not a amp using tag nor a query sting.This issue seems similar to this topic, but it seems the problem wasn’t fixed.
The invalid script tag is caused by this function “w3tc_popupadmin_bar”. See full log below:
Informatie AMP does not allow the use of JS <script> tags unless they are for loading AMP components, which are added automatically by the AMP plugin. For any page to be served as AMP, all invalid script tags must be removed from the page. Instead of custom or third-party JS, please consider using AMP components and functionality such as amp-bind and actions and events (as opposed to JS event handler attributes like onclick). Some custom JS can be added if encapsulated in the amp-script. Learn more about how AMP works. If all invalid markup is “removed” the page will be served as AMP. However, the impact that the removal has on the page must be assessed to determine if the result is acceptable. If any invalid markup is “kept” then the page will not be served as AMP. Error code DISALLOWED_TAG Invalid markup <script … > Element attributes type text/javascript Element name script Parent element head Text content function w3tc_popupadmin_bar(url) { return window.open(url, __SINGLE_QUOTED_STRING__, __SINGLE_QUOTED_STRING__); } Sources #1 Type: Core Naam: wp-includes Functie: wp_print_head_scripts() Actie: wp_head (priority 9) Locatie: script-loader.php:2031 #2 Type: Plugin Naam: W3 Total Cache (w3-total-cache) Functie: W3TC\Generic_Plugin::popup_script() Actie: wp_print_scripts (priority 10) Locatie: Generic_Plugin.php:648
Thanks in advance!!
- This topic was modified 3 years, 3 months ago by .
- This topic was modified 3 years, 3 months ago by .
- This topic was modified 3 years, 3 months ago by .
The page I need help with: [log in to see the link]
Viewing 6 replies - 1 through 6 (of 6 total)
Viewing 6 replies - 1 through 6 (of 6 total)
- The topic ‘W3TC not valid for AMP’ is closed to new replies.