Every WordPress site by default has a meta tag that states the used WordPress version like this one:
<meta name="generator" content="WordPress 5.3.2" />
The WordPress version is public and easily accessible – just look at the source of the webpage using Ctrl+U / Cmd + U or typing the following address: view-source:https://www.your-website.com/
If you are running the most up to date version of WordPress, then you don’t have to worry about this tutorial at all. But if for some reason you are not, then it is in your best interest to continue reading.
The malicious access attempts become much easier if unauthorized parties know which WordPress version is used on your website. This is why it’s good security measure to remove the WordPress version from your website.
You may be told to open header.php of your WordPress theme and look for and get rid of:
<meta name="generator" content="WordPress <?php bloginfo('version'); ?>" />
Or to add
in functions.php but both ways are not complete and one experienced hacker could easily find the WordPress version in your RSS Feed for example. So the right way to remove the WordPress version of your website is by using the_generator filter.
PHP Snippet: How to completely remove the WordPress version
Add the following snippet to your child theme’s functions.php file and remove the WordPress version from all different areas on your site.