In comments, I want to limit author names. For example, the author's name should be no more than 10 characters. I'm looking for a way to do this. Thank you very much in advance.


1 Answer 1


There's a filter called get_comment_author that you can hook into to modify a comment author's appearance.

add_filter( 'get_comment_author', function( $author, $comment_id, $comment ) {

    // limit to first 10 characters
    $author = substr( $author, 0, 10 );

    return $author;
}, 10, 3 );
  • Thank you very much. It definitely works. I wish you a happy day!
    – A. Muller
    Dec 5, 2018 at 18:19

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.