Web Design. Web Development. Web Hosting.
0 items

WordPress: Remove generator meta tags for AMP Plugin

Need some help? We are here for you!

We have a very friendly service - Come and chat to us and let us know what you need, we work for an hourly fee and can also provide you a no obligation quote and begin work immediately in most cases. Click "Request Support" or use our Live Chat.

Request support

WordPress AMP plugin by Automattic is a great plugin for adding a seamless AMP version of your WordPress blog, one thing we noticed which we was not happy about was the fact that it adds 2 meta tags into the header of the AMP pages, one pointing out that your using the AMP plugin with version number and another pointing out your using WordPress and the version number, both tags are not only completely USELESS but could present a serious security concern as your basically telling everyone what your site is running under with version number and also what AMP plugin your using with version number making it easy to focus penetration through any known vulnerabilities that might exist at present or in future.

This is what they look like in the source code:

<meta name="generator" content="AMP Plugin v1.5.0; mode=reader">
<meta name="generator" content="WordPress 5.3.2">

 

Fortunately you can remove both meta tags very easily by adding this code into the functions.php file of your theme:

<?php
// Remove AMP generator meta tag and WordPress generator tag on AMP.
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' ); 
 remove_action('amp_post_template_head', 'wp_generator');
}
?>

 

Alternatively you could install our AMP ToolBox for WordPress plugin, which not only removes these for you without editing your functions file, but also gives you other options such as the ability to set-up your header logo on AMP pages and change some other features.

0 0 votes
Article Rating
Need some help? We are here for you!

We have a very friendly service - Come and chat to us and let us know what you need, we work for an hourly fee and can also provide you a no obligation quote and begin work immediately in most cases. Click "Request Support" or use our Live Chat.

Request support
Author: Dean WilliamsProfessional PHP Web Developer with expertise in OpenCart Web Development, WordPress Web Development, Bespoke Systems - also a seasoned Linux Server Administrator.


Subscribe
Notify of
0 Comments
Inline Feedbacks
View all comments


Share this page..

Let's begin your journey...

Get in touch us now to begin your journey to having a beautifully crafted mobile responsive website. If you're still unsure what we could do for you then take a look at our why us page which includes reviews, or take a look at our portfolio.

We can work on improving existing websites or craft a new stylish website making your business stand out.

You could always catch us by email, telephone, Skype or live chat to us below.


    0
    Would love your thoughts, please comment.x
    ()
    x