WP Tutorial: Remove admin name in comments class


Sponsored Links




Batovasan, create nicely WordPress Tutorial. The reason create this tutorial is Small Security Hole on WordPress.

Remove admin name in comments class - Miranda Kerr Pictures

Remove admin name in comments class - Miranda Kerr Pictures

Like we all know by default, when the blog admin left a comment on his blog, WordPress use the name in the comment css class. This is useful for styling, but it will also let people know about your admin login name. This is not good, because some hacker or whatever we call it, can use this info to crack our WordPress site.

The Solutions is simple, 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. I hope you enjoy this tiny tricks on WordPress. Thanks for WP Recipes to share it

Subscribe to Full RSS Feed

RSS FeedIf you thing this article useful, please consider subscribing to our RSS Feed or e-mail updates and stay updated with us. You can also follow @WPTricksNet on twitter for latest updates.

About WP Tricks

We are WordPress Family, we collected and writed useful tips and tricks for you WordPress. We share it for you...

Related Tips and Trick from Local Data and on The Net

Customizing Your WordPress Admin | Wptuts+

In this tutorial, I will show you how to tame your admin menu. at the end of this tutorial). So, for example, if you wanted to remove You can replace the class name Read More

Top 10 Steps to Secure Your WordPress | Wptuts+

Please make sure you are in the wp-admin folder right above public_html), then you remove the sensitive stuff from wp You can replace the class name with "js," "css Read More

How to Remove the Password Reset / Change option from WordPress

and we will also show you how to remove the ability for non-admin Open a blank php file and name it disable() { if ( is_admin() ) { $userdata = wp_get Read More

Admin Bar Tricks | Digging into WordPress

global $wp_admin_bar; $wp_admin_bar->remove_menu('comments link title 'href' => admin_url( 'media-new.php') // name of Great tutorial, thanks :) Read More

Add Useful Links to WordPress Admin Bar | Pro Blog Design

Read More


2 Responses to WP Tutorial: Remove admin name in comments class

  1. Pingback: Tweets that mention How To Remove admin name in comments class # WordPress Tricks & Tips -- Topsy.com

  2. Pingback: Display Clean Pingbacks and Trackbacks | Unlock IMEI Cellphones

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>