Software Developer

Remove generator meta tag for WordPress AMP Plugin

This is how to remove the generator meta tag for the WordPress AMP Plugin. This refers to the WP AMP plugin by Automattic.

The new generator meta tag was added in the AMP plugin version 0.6.0. It looks like this in your sourcecode:

<meta name="generator" content="AMP Plugin v0.6.0" />

To remove the meta tag, use the following PHP code snippet.

(See how to add PHP code to your site.)

// Remove AMP generator meta tag.
add_action( 'amp_post_template_head', 'isa_remove_amp_generator_meta_tag', 2 );
function isa_remove_amp_generator_meta_tag() {
	remove_action( 'amp_post_template_head', 'amp_add_generator_metadata' ); 
}

See more ways to customize the WP AMP plugin.

By

We've 2 Responses

  1. June 25th, 2018 at 5:17 pm

    Hello Isabel:
    Thank you for info.
    Your code worked after I changed `$accepted_args` to zero.

    add_action( 'amp_post_template_head', 'isa_remove_amp_generator_meta_tag', 0 );
    

    Best wishes,
    Mitchell

    avatar

Leave a Reply to Abhijeet Cancel reply

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]