Lazy Load Breaks AMP Validation [DEPRECATED]

Please Note: This wiki is no longer valid for modern versions of LiteSpeed Cache for WordPress. Additionally, LSCWP documentation has moved to a new location.

When Lazy Load is enabled in the LiteSpeed Cache plugin for WordPress, it can break AMP validation.

Add the following code to your theme's functions.php:

function_exists( 'is_amp_endpoint' ) && is_amp_endpoint() && ! defined( 'LITESPEED_NO_LAZY' ) && define( 'LITESPEED_NO_LAZY', true ) ;

Purge the cache. This will disable Lazy Load on all AMP pages.

In some theme , if that code doesn't work when inserted in theme's functions.php, you can also insert it into /wp-content/plugins/amp/includes/class-amp-theme-support.php

A permanent solution will be integrated into LiteSpeed Cache for WordPress, starting with version 3.0. Please update to 3.0 once it becomes available.

  • Admin
  • Last modified: 2020/11/14 16:00
  • by Lisa Clarke