Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save tahirtaous/6d37b5f1692600024ef6 to your computer and use it in GitHub Desktop.
Save tahirtaous/6d37b5f1692600024ef6 to your computer and use it in GitHub Desktop.
Security through obscurity is the name of the game here. These functions do three different things. Remove the version string from the code. No point in telling folks what version we're running. Removes any error messages (Wrong Password, No Such User, etc.) from admin login screens When the admin posts a comment, a CSS class is added. This remo…
// Source http://wordpress.stackexchange.com/posts/28530/revisions
// Tested and worked on WordPress 4.1 Beta
//REMOVE VERSION STRING FROM HEADER
remove_action('wp_head', 'wp_generator');
//HIDE LOGIN ERROR MESSAGES (Wrong Password, No Such User etc.)
add_filter('login_errors',create_function('$a', "return null;"));
// Remove admin name in comments class
// Source: http://www.wprecipes.com/wordpress-hack-remove-admin-name-in-comments-class
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' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment