Created
July 22, 2021 11:26
-
-
Save codenathan/8ede14e71edd1c67cc09b5a812f58e6f to your computer and use it in GitHub Desktop.
Wordpress - Basic Security Features
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 | |
//SOME BASIC WORDPRESS SECRUITY | |
// add this to your functions.php | |
add_filter('xmlrpc_enabled', '__return_false'); | |
remove_action('wp_head', 'rsd_link'); //removes EditURI/RSD (Really Simple Discovery) link. | |
remove_action('wp_head', 'wlwmanifest_link'); //removes wlwmanifest (Windows Live Writer) link. | |
remove_action('wp_head', 'wp_generator'); //removes meta name generator. | |
remove_action('wp_head', 'wp_shortlink_wp_head'); //removes shortlink. | |
remove_action('wp_head', 'feed_links', 2); //removes feed links. | |
remove_action('wp_head', 'feed_links_extra', 3); //removes comments feed. | |
remove_action('wp_head', 'print_emoji_detection_script', 7); | |
remove_action('wp_print_styles', 'print_emoji_styles'); | |
//remove wp version | |
function theme_remove_version() | |
{ | |
return ''; | |
} | |
add_filter('the_generator', 'theme_remove_version'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment