small security for wordpress site

Sponsors

Here is one small security to protect your wordpress site.

We all know that, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. If admin left a comment on his blog any would-be hacker/cracker only has to figure out your password–making it much easier to get into your site. So..

Remove admin name in comments class

Here’s simple solution, put this code on your functions.php

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

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' );

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The code above will clean comment_class for the author.

Thank You!

You may like following Articles!

8 thoughts on “small security for wordpress site

Leave a Reply

Your email address will not be published. Required fields are marked *

*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>