Title: AMP pages optimization disabling
Last modified: February 14, 2019

---

# AMP pages optimization disabling

 *  Resolved [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/)
 * Litespeed plugin makes website load and work much faster on the Litespeed hosti
   server I’m using.
 * However, I’ve noticed that some optimizations create problems with AMP validation.
   Lazy image load for example.
 * Question: can you implement an option to “tell” Litespeed plugin:
    “Don’t use
   this optimizations for any URL containing /?amp string”
 * I know that I can exclude caching for /?amp URLs, but that doesn’t prevent the
   plugin from doing all the enabled optimizations of /?amp URLs, hence, I get validation
   problems.
 * So, I can either disable some optimizations for the whole website, or have the
   website’s AMP pages not work correctly.
 * It seems as if it’s needed to exclude some optimizations for /?amp URLs.
 * I could provide a list of optimizations that create problems, so you could add
   that option as one setting, perhaps. So there’s not too many menu options. That
   is – no need to add URL exclusion entry for each and every optimization, just
   make one, like:
 * “Enter URL for your website amp pages (“/?amp”, or “/amp”, or whatever you are
   using) so ‘AMP-problematic” optimizations will be excluded for those URLs, even
   if those optimizations are enabled for the ‘desktop website version’.”
 * Not sure if I’ve explained what I mean, do ask for clarification if needed – 
   English is not my native.
 * The page I need help with: _[[log in](https://login.wordpress.org/?redirect_to=https%3A%2F%2Fwordpress.org%2Fsupport%2Ftopic%2Famp-pages-optimization-disabling%2F%3Foutput_format%3Dmd&locale=en_US)
   to see the link]_

Viewing 15 replies - 1 through 15 (of 15 total)

 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11204860)
 * List of problematic optimizations which, when disabled, allow AMP page versions
   to pass verification and work fine:
 * (5) Optimize
 * Load CSS Asynchronously
 * (7) Media
 * Lazy Load Images
    Lazy Load Iframes
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11204994)
 * Hi,
 * Please check this wiki
 * [https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:tuning](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:configuration:tuning)
 * there is a section “URI Excludes” , add “amp” there should disable optimization
   on any URI string contains “amp”
 * Could you please do a screenshots of how the page is broken with css async and
   lazy load?
 * Best regards,
 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 4 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11205774)
 * Listing ?amp, or /?amp in URI Excludes didn’t help with Lazy Load Images optimization,
   for example.
 * It seems that LiteSpeed still does optimization of pages listed in URI Excludes.
   Might be that the Exclusions work only for optimizations listed under (6) Tuning,
   not for other optimizations.
 * Pages aren’t broken – they load fine. But, with “problematic” optimizations activated,
   pages don’t pass AMP validation – hence they won’t get stored in Google’s AMP
   cache and shown to visitors as such in mobile phone search results.
 * My site page that shows how AMP is implemented and set up on it:
    [https://bike.bikegremlin.com/7100/amp-wordpress/](https://bike.bikegremlin.com/7100/amp-wordpress/)
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11209077)
 * Hi,
 * By ” with “problematic” optimizations activated,” you mean the lazy load will
   break AMP validation ?
 * Best regards,
 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11209106)
 * Yes, exactly. It does break AMP validation. All the other “problematic” ones 
   do.
 * Test method:
 * – Enable an optimization.
    – Purge all the cache. – Do a validation test (both
   using google and amp-project official validation test tools). – If a validation
   test fails – disable the optimization, purge the cache again and test validation
   again to confirm the optimization was the cause.
 * Did that for each optimization to figure out which ones cause problems.
    -  This reply was modified 7 years, 3 months ago by [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/).
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11209142)
 * Hi,
 * I’m little confused , is lazy load the ONLY one breaks it ? or others breaks 
   it as well ?
 * and may I know which AMP plugin you are using ?
 * Best regards,
 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11209202)
 * First I’d like to thank you for taking the time to look into this – much appreciated.
 * List of problematic optimizations (for my website at least):
 * (5) Optimize
    Load CSS Asynchronously
 * (7) Media
    Lazy Load Images Lazy Load Iframes
 * I’m using **[AMP plugin](https://wordpress.org/plugins/amp/)** (by WordPress.
   com)
 * Complete list of **[how I’ve set up amp on my website](https://bike.bikegremlin.com/7100/amp-wordpress/)**.
 * Regards,
    Relja
 *  [lisanibnu](https://wordpress.org/support/users/lisanibnu/)
 * (@lisanibnu)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11217664)
 * I agree with bikegremlin , lazyload in litespeed does not support with AMP if
   enable, so have to use disable this feature maybe next update can be improve 
   to full approve AMP
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11217757)
 * Hi,
 * Yes, I did some check
 * It inserts this code
 * `<script src="https://example.com/wp-content/plugins/litespeed-cache/js/lazyload.
   min.js"></script></body></html>` into AMP page that breaks the validation.
 * We will make improvement on this 🙂
 * Best regards,
 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11217796)
 * In my opinion (correct me if I’m wrong) – there really is no sense in using any
   of the three “problematic” optimizations for any AMP page. Why?
 * Those pages are downloaded by Google, validated, then stored at Google CDN network
   for AMP pages.
 * AMP is not directly serverd to “live” visitors on a website, so there’s no need
   to “lazy load images”, for example. Google has to download the entire page to
   their CDN, so it makes absolutely no difference whether, while doing that, Google
   needs to wait fot the images to load before the remiander of the page test, or
   it first loads text and image frames, then images themselves. It has to get the
   entire copy any way.
 * So lazy load, async scripts and any other modifications won’t help Google download
   the entire page more quickly, but can cause prolbems.
 * That is why I think it would be best to just disable these optimizations for 
   AMP pages.
 * Let me know if my comment needs more explaining – again, English not being my
   native.
 * As far as errors are concerned:
    There are 4 separate validation errors caused
   by these three “problematic optimizations” (nothing wrong with them as they are,
   your plugin is brilliant, just AMP doesn’t like it for several reasons).
 * One of the optimizations causes two errors, while the others cause one each.
 * If you wish, I could re-enable each and let you know which error they cause. 
   Just let me know.
 * Regards
 *  Plugin Support [qtwrk](https://wordpress.org/support/users/qtwrk/)
 * (@qtwrk)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11218823)
 * Hi,
 * Please check this temporarily [solution](https://www.litespeedtech.com/support/wiki/doku.php/litespeed_wiki:cache:lscwp:troubleshooting:lazy_load_amp).
 * Best regards,
 *  Thread Starter [Bike Gremlin](https://wordpress.org/support/users/bikegremlin/)
 * (@bikegremlin)
 * [7 years, 3 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11219087)
 * Thank you very much. Will give it a try.
 * Plugin works fast and good as it is. Adding full AMP compatibility/customization
   with the update would certainly be a good thing though.
 * I think it’s only fair to mark this thread as “resolved” and wait for the update.
 * P.S. Great work on the plugin, will make sure to write a review.
 * Regards,
    Relja
 *  [G.Jonsson](https://wordpress.org/support/users/gudmundur/)
 * (@gudmundur)
 * [7 years, 2 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11394753)
 * Hi [@bikegremlin](https://wordpress.org/support/users/bikegremlin/) and thank
   you for pointing this out, I was having exactly the same problem (i was literally
   going crazy on this)… and thank you very much for the temporarily solution [@qtwrk](https://wordpress.org/support/users/qtwrk/).
 *  [anoirinoh](https://wordpress.org/support/users/anoirinoh/)
 * (@anoirinoh)
 * [6 years, 10 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11806753)
 * Hey there,
    It seems you found a temporary solution for the lazy load image. 
   But what about Load css asynchronously? Any solution or should I just turned 
   it off? Thanks
 *  [WPO+](https://wordpress.org/support/users/ivanpr/)
 * (@ivanpr)
 * [6 years, 9 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11940341)
 * With the following code in the functions.php:
    `function_exists( 'is_amp_endpoint')&&
   is_amp_endpoint() && ! defined( 'LITESPEED_NO_LAZY' ) && define( 'LITESPEED_NO_LAZY',
   true ) ;`
 * all the other conflicting optimizations can be disabled in:
    Admin > LiteSpeed
   Cache > Tuning > URI Excludes > ‘/?amp’
    -  This reply was modified 6 years, 9 months ago by [WPO+](https://wordpress.org/support/users/ivanpr/).

Viewing 15 replies - 1 through 15 (of 15 total)

The topic ‘AMP pages optimization disabling’ is closed to new replies.

 * ![](https://ps.w.org/litespeed-cache/assets/icon-256x256.png?rev=2554181)
 * [LiteSpeed Cache](https://wordpress.org/plugins/litespeed-cache/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/litespeed-cache/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/litespeed-cache/)
 * [Active Topics](https://wordpress.org/support/plugin/litespeed-cache/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/litespeed-cache/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/litespeed-cache/reviews/)

 * 15 replies
 * 6 participants
 * Last reply from: [WPO+](https://wordpress.org/support/users/ivanpr/)
 * Last activity: [6 years, 9 months ago](https://wordpress.org/support/topic/amp-pages-optimization-disabling/#post-11940341)
 * Status: resolved