Last active
January 30, 2024 14:48
-
-
Save knolaust/4b133228082f5de4b5864d60150deccb to your computer and use it in GitHub Desktop.
Remove WordPress Version Number
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
/** | |
* Removes the WordPress version number from the HTML generator tag. | |
* | |
* This function attaches to the 'the_generator' filter hook and replaces the | |
* default WordPress generator string with an empty string. This is often used | |
* for security purposes to obscure the WordPress version number. | |
* | |
* @link https://developer.wordpress.org/reference/hooks/the_generator/ WordPress Hook: the_generator | |
* | |
* Gist Keywords: wordpress, functions, meta | |
* | |
* @author Knol Aust | |
*/ | |
add_filter('the_generator', '__return_empty_string'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment