WordPress – How to remove meta generator tags?

WordPress - How to remove meta generator tags?

Bài viết này thực hiện (hoặc lụm bài về đăng câu like từ các trang khác) bởi Việt Lâm Coder một YOUTUBER có tâm và đẹp trai siêu cấp vô địch zũ trụ.

WordPress Meta Generator Tag generates codes or tags for search engines to pick up your page titles and meta descriptions. These are HTML codes used to describe the content of a page. Meta generators are always put within the head section of the code. However, displaying the meta generator tags has security issues attached to it.

In this article, I will show you the reason behind removing the meta generator tag and how you can remove the WordPress meta generator tag real quick.

Why remove the Meta Generator Tag?

Where the Meta Generator tags do not add additional value to SEO (Search Engine Optimization). It does display the WordPress version number. Now, exposing your WordPress version number publicly makes you vulnerable to version-related attacks.

Hence, removing the meta generator tag protects you against the version-targeted attacks. Deflecting a little from the topic, I will advise that you update your WordPress core version regularly. Know that the newer versions provide better security as it generally contains security patches for known vulnerabilities. You can use the WordPress auto-update feature to update the core version.

Coming back to meta generators, I have already talked about the risks they bring, the process of removing them is talked about in the next segment.

How to remove WordPress Meta Generator Tag?

WordPress removed (from version 2.5 and onwards) meta generator tag from the Template description and added it to the core. After this change, you couldn’t remove the WordPress meta generator tag from the template files simply.

I am assuming that you are on a version >2.5, in that case, you can remove the meta generator tag as following:

1. Remove WordPress Meta Generator Tag using a plugin

To make your life easy, Astra has designed this WP Hardening Plugin using which you can remove the WordPress Meta generator with just a click.

WordPress - How to remove meta generator tags?

Here is how it works:

  1. Install WP Hardening from the WordPress store.
  2. Activate it. The WP Hardening icon will reflect in the bottom left corner of your admin panel.
  3. Navigate to the “Security Fixers” tab in the plugin and just flick the toggle key next to the option “Remove Meta Generator tag.
    WordPress - How to remove meta generator tags?
  4. And you are done.

In addition to removing the meta generator tag, you can use this plugin to fix several other security areas. I have listed then here:

  • Stop User enumeration
  • Change login URL
  • Disable XMLRPC
  • Disable WP API JSON
  • Disable File Editor
  • WordPress version number
  • Remove WordPress Meta Generator Tag
  • Remove WPML (WordPress Multilingual Plugin) Meta Generator Tag
  • Remove Slider Revolution Meta Generator Tag
  • Remove Visual Composer / WPBakery Page Builder Meta Generator Tag
  • Remove Version from Stylesheet
  • Remove Version from Script
  • Hide directory listing of WP includes

All this you can do with just a toggle of a button.

2. Remove WordPress Meta Generator Tag from functions.php

Another way you can remove the meta generator tag from your WordPress is by editing the function.php file. All that you have to do is add the following line of code to the functions.php of a site-specific plugin:

remove_action('wp_head', 'wp_generator');

Note: This method is recommended for coding professionals only. If you have no experience with coding or are not confident enough, do not edit files, if done wrong this may break your site.

Bài viết này thực hiện (hoặc lụm bài về đăng câu like từ các trang khác) bởi Việt Lâm Coder một YOUTUBER có tâm và đẹp trai siêu cấp vô địch zũ trụ.

Liên hệ ngay với Việt Lâm Coder
Xin chào! Chúng tôi có thể giúp gì cho bạn ?
Gọi ngay cho chúng tôi