Hello @egornmore
Thank you for support topic, HTML comments are stripped out to optimize the DOM
Also please note that conditional HTML comments are not allowed on AMP
Hope this helps!
If you want to turn off HTML comment removal, you can use this PHP plugin code:
add_filter( 'amp_optimizer_config', static function ( $config ) {
$config['transformers'] = array_diff(
$config['transformers'],
[
\AmpProject\Optimizer\Transformer\MinifyHtml::class,
]
);
return $config;
} );
It works
Thanks for your time!
(@egornmore)
4 years, 3 months ago
Hello,
Is there any way to add HTML comments <!– –> in the head tag? I’m trying to do so using ‘wp_head’ function but comments don’t appear