How to Automatically Add a Signature to Admin Comments

Snippets by IsItWP

Are you looking for a way to display a signature after each admin comment? While there’s probably a plugin for this, we have created a quick code snippet that you can use to automatically add a signature to admin comments in WordPress.

You may need to update the ID number, the default is set to ‘1’ and of course change the text displayed within the signature.


All you have to do is add this code to your theme’s functions.php file or in a site-specific plugin:

add_filter( 'comment_text', 'my_comment_text' );
function my_comment_text( $mytext ) {
	$id = get_comment(get_comment_ID())->user_id;
	global $comment;
	if($id == 1 ){
		$mytext = get_comment_text( $comment ) . '<hr />Test comment text!';
		$mytext = get_comment_text( $comment );
	return $mytext;

Note: If this is your first time adding code snippets in WordPress, then please refer to our guide on how to properly copy / paste code snippets in WordPress, so you don’t accidentally break your site.

If you liked this code snippet, please consider checking out our other articles on the site like: 6 best image optimization plugins for WordPress and how to track affiliate links in Google Analytics.

Comments  Leave a Reply

  1. Doesn’t work, bro. Displays signature for ALL comment authors… not just admins.

    1. Hi Ttomp,
      Your right was not sure what I was up to that day lol, anyway I updated the snippet and it is working properly now.

      1. Ernesto Marrero April 18, 2013 at 3:34 pm

        Is possible, for any way, add the boton Twitter

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our privacy policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

WordPress Launch Checklist

The Ultimate WordPress Launch Checklist

We've compiled all the essential checklist items for your next WordPress website launch into one handy ebook.
Yes, Send Me the Free eBook!