Wordpress LScache Plugin: LiteSpeed Cache breaks AMP
Last Updated on: Wed, 15 Apr 2026 00:00:02 On my website I use LiteSpeed and AMP plugins. The later cant be used in standard mode where AMP version is served by default, and Id like it that way. Problem is that LiteSpeed plugins breaks AMP validation. If I turn debug mode on, I receive errors: is_amp_endpoint() was called before the parse_query hook was called and is_amp_endpoint() was called before the wp action which means it will not have access to the queried object to determine if it is an AMP response, thus neither the amp_skip_post filter nor the AMP enabled publish metabox toggle will be considered. That is the case only if LiteSpeed is turned on. Ive checked it by disabling plugins one by one ? its LiteSpeed that causes that, without it its fine, AMP works. Theme is unmodified Twenty Twenty, which works with standard AMP mode. Ive searched LiteSpeed files for is_amp_endpoint usage, and found a function which should make sure to disable lazyload on amp. That shouldnt cause any trouble, but just for test Ive deleted that line with is_amp_endpoint. And it changed nothig, errors are still there, after cleaning cache on my site and cloudflare. Is there anything I can do to make LiteSpeed work with AMP? The page I need help with: https://kamster.pl I was able to replicate issue on local environment. Ive installed AMP and lightspeed cache on fresh wp, activated twenty twenty, both plugins and amp is broken. Deactivating lightspeed makes it work. Hi, There are several AMP plugins , could you please state which one you are using ? I will try to reproduce the issue locally as well. Best regards, https://wordpress.org/plugins/amp/ Hi, I have enabled wp debug also the log may I know the steps for how to trigger/reproduce the error as you have seen ? Best regards, Ive activated Twenty Twenty theme, activated LiteSpeed plugin and AMP plugin (https://wordpress.org/plugins/amp/), set AMP mode to Standard in settings. It shows error that it couldnt retrieve amp status due to failed json fetch. Then I just open any page or post, and the is_amp_endpoint() was called before ? errors pops up Hi, I did see the json fetch validation issue when save to Standard But how do I trigger that is_amp_endpoint() was called before ? Best regards, I was able to resolve issue by desactivating lazy images loading in Media Setting Menu? Funny thing, its not present now ? dunno whats changed, as I have auto-updates turned on. Maybe one of mentioned plugins changed, maybe it was another plugin that was interfering with LiteSpeed. So, is_amp_endpoint() is no longer an issue, but json fetch is still failing with LiteSpeed turned on, and works fine with disabled. Tried to turn off option by option in LiteSpeed configuration, including lazy load, purging cache after every change, but its still the issue. Its problem with comment appended to sites html ? Weston Ruter found it out, apparently he already posted you an issue on github. https://wordpress.org/support/topic/amp-not-working-with-litespeed/#post-12716486 https://github.com/litespeedtech/lscache_wp/issues/212 Hi, Thanks for the info , we will look into it. Best regards,
LiteCache Rush: Speed comes from using less, not from doing it faster
Reference