1

When using comments_template(), all comments starts with { Username } says.

How can I remove that "says" part? In most solutions that I found, it suggests using CSS like:

.says { display: none; }

But the string isn't wrapped in a div called says.

Any suggestions? Thanks!

  • 1
    If you look in your theme folder you should see a file called comments.php. Look in there to see if you have find the area that prints out the username. You can update that file and save it in a child theme. If you find that is the correct file let me know and I'll make it the answer. – Fencer04 Aug 19 '16 at 16:07
  • May you provide us a link to your site where you see "says" in the comment? Each theme varies with their style. This will help me find the actual class name that you need to refer to. – Ethan Jinks O'Sullivan Aug 19 '16 at 16:59
2

The answer from @the_dramatist is probably the simplest if that's all you want to do, but you can remove it completely and customize everything else as well by creating your own comment template.

As Ethan mentioned in the comment on your question, every theme is different, meaning that most themes have a comment template that is inserting this or are using the default template. If your theme has a custom comment template already, just edit that one otherwise it's using the default comment function which includes the comment author says text.

If you have anything else besides that that you'd like to customize you're better off creating your own template or function for this. You can create a [custom callback or custom walker.

Then you'd use wp_list_comments() to output your new comment template.

So basically here's the process of doing this with templates:

1) Create your callback or comment walker in functions.php or similar

2) Create a comments.php file and call your new function:

Walker

<?php
wp_list_comments( array(
    'walker' => new Walker_Comment()
) );

Callback

 <?php wp_list_comments('type=comment&callback=format_comment'); ?>

3) Output your comment template on single.php

<?php comments_template(); ?>
1

Hope this is gonna help. Please try this snippet. Put it in your themes functions.php or you could it load it thorough a plugin or any other way-

function the_dramatist_remove_says_from_comment( $translation, $text, $domain ) {
    //what text you want to have instead of 'says' in comments. For removing 'says' keep this blank
    $new_var = '';
    $translations = &get_translations_for_domain( $domain );
    if ( $text == '<cite class="fn">%s</cite> <span class="says">says:</span>' ) {
        if($new_var) $new_var = ' '.$new_var; //compensate for the space character
        return $translations->translate( '<cite class="fn">%s</cite><span class="says">'.$new_var.':</span>' );
    } else {
        return $translation; // standard text
    }  
}
add_filter('gettext', 'the_dramatist_remove_says_from_comment', 10, 4);
0

You need to add a simple function in your functions.php file that allows you to remove or modify or change “Says” word from WordPress comments. Please insert this code into your functions.php file.

add_filter( 'comment_author_says_text', 'rm_comment_author_says_text' );
function rm_comment_author_says_text() {
    return 'Your Text';
}

You will find full instructions here on my website - Remove or Modify “Says” From WordPress Comments

  • 2
    Hi Ratan, please take needed information here and disclosure – bummi Nov 13 '17 at 6:34
  • This doesn't work. – antikbd Dec 1 '18 at 15:07

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.