SG Optimizer breaks AMP validity
-
Hello! I’m a maintainer of the official AMP plugin. I’ve received several reports about SG Optimizer breaking AMP validation. This is due to things like AMP CDN scripts being concatenated and minified like so:
<script src="https://example.com/wp-content/uploads/siteground-optimizer-assets/siteground-optimizer-combined-js-676828fd0b675433ed1ac049b13c3818.js"></script>
When they need to be left as-is, for example:
<script async src="https://cdn.ampproject.org/v0.js"></script> <script src="https://cdn.ampproject.org/v0/amp-analytics-0.1.js" async custom-element="amp-analytics"></script>
Can the optimizations that break AMP compatibility be exempted when AMP pages are being served? There is the
is_amp_endpoint()
function which can be used to detect whether the page is AMP (note it must be called at or after thewp
action). The AMP plugin also includes many optimizations built-in, so it may not be relevant for SG Optimizer to do anything on AMP pages.
- The topic ‘SG Optimizer breaks AMP validity’ is closed to new replies.