

But I can’t understand what amp has to do with the admin panel? I don’t know if my question is correct, but this is what I have got so far.įollowing is the ad code I am using in an Html widget in the sidebar. – Serve the functionality in an iframe via amp-iframe.Īfter reaching other plugin support, I’ve realized that all those “invalid scripts” are occurring for the backend only (I am not 100% sure, but most of them said about their plugins). – Refactor your JS to be containable in amp-script. While the AMP plugin removes custom JS it will at the same time unwrap noscript tags, so if you have fallback behavior for when JS is turned off in the browser, then this will become the baseline AMP experience. – Use an AMP component that implements the desired functionality.ĭevelop an alternative that works with JS turned off. You’ll need to find an alternative to using custom JS. Warnings are different from errors, warning the script will be removed, and your page continues valid.īut in the case you need to use this script in AMP version. And for the AMP version, you use your AMP compatible ads plugin.

The script will run normally in a non-AMP, at the AMP version the script tag will be removed, and a warning will be triggered, but you mark as solved, because this is an expected behavior. Let’s say you want to display non-amp ads on a non-amp: page it is fine. Let me know which widget and the code you are using on your sidebar, and I can suggest some solutions.Ī reminder from previous conversation, AMP does not allow custom JavaScript, at least in the traditional way. Hi for contacting us, I hope that you had a nice weekend.
