diff --git a/classes/Webp/Picture/Display.php b/classes/Webp/Picture/Display.php index 7a475327a..639220774 100644 --- a/classes/Webp/Picture/Display.php +++ b/classes/Webp/Picture/Display.php @@ -229,7 +229,11 @@ protected function build_picture_tag( $image ) { unset( $attributes['data-object-position'] ); } - $output = 'build_attributes( $attributes ) . ">\n"; + $picture_attributes = array_filter( $attributes, function ( $attribute ) { + return strpos( $attribute, 'data-wp' ) === false; + }, ARRAY_FILTER_USE_KEY ); + + $output = 'build_attributes( $picture_attributes ) . ">\n"; /** * Allow to add more tags to the tag. *