Snippet: Remove WordPress Version Number
Another quick PHP snippet to add to your chosen code plugin.
Why do this? To be honest, it’s not going to have a huge performance impact but it has been noted that some older brute force hacking used to use your WordPress version number to know which attack would work best.
For example, if there was a known security flaw with WordPress version 6.2.3, a mallicious bot could scan your file contents and discover your version number easily. If it found a match the chances of it deploying the hack is much greater than if they don’t know what version you are running.
add_filter('the_generator', '__return_empty_string');