How to Remove Site Icon From the Header of AMP Pages

If you are using the official AMP plugin for WordPress, and you want to remove the site icon from the header of all your AMP posts and pages, this is how to do that.

This site icon is easily hidden with CSS. However, you do not add this CSS the regular way in your WordPress dashboard because you need to add CSS for AMP pages by using a function.

So, to hide the site icon from the top of all your AMP posts and pages, add the following code snippet to your functions.

/**
 * Remove site icon from AMP posts header
 */
add_action( 'amp_post_template_css', 'isa_amp_css_remove_siteicon' );
function isa_amp_css_remove_siteicon( $amp_template ) {
    ?>
	.amp-wp-header .amp-wp-site-icon {
		display: none;
	}
	<?php
}

That function adds the necessary CSS styles to your AMP posts and pages.

See how to remove the generator meta tag from AMP pages, or more ways to customize the WP AMP plugin.

See more: ,

We've One Response

Questions and Comments are Welcome

Your email address will not be published. All comments will be moderated.

Please wrap code in "code" bracket tags like this:

[code]

YOUR CODE HERE 

[/code]