AgilityWeb
8/26/2018 - 3:44 PM

Security Functions

/******************************************/
/*           WORDPRESS SECURITY           */
/******************************************/

// Remove author's login from comments
function remove_comment_author_class( $classes ) {
 foreach( $classes as $key => $class )
  if(strstr($class, 'comment-author-' ))
   unset( $classes[$key] );
 return $classes;
}
add_filter( 'comment_class' , 'remove_comment_author_class' );

// Remove login error messages
function remove_login_error_msg() {
 return 'Et alors...?';
}
add_filter( 'login_errors', 'remove_login_error_msg' );

// Disable XMLRPC
add_filter('xmlrpc_enabled', '__return_false');
remove_action('wp_head', 'rsd_link');

// Remove WordPress version number
remove_action('wp_head', 'wp_generator');

// From RSS feed
function remove_version_wp() {
 return '';
}
add_filter(‘the_generator’, ‘remove_version_wp’);

// Remove included css/js version numbers
function remove_ver_css_js( $src ) {
 if ( strpos( $src, 'ver=' . get_bloginfo( 'version' ) ) )
  $src = remove_query_arg( 'ver', $src );
 return $src;
}
add_filter( 'style_loader_src', 'remove_ver_css_js', 9999 );
add_filter( 'script_loader_src', 'remove_ver_css_js', 9999 );