将rel =“nofollow”添加到comment_metadata

how can i add rel="nofollow" to link that have time tag, inside the comment-metadata div?

<div class="comment-metadata">
<a href="http://localhost/wordpress/hello-world/#comment-2">
<time datetime="2013-12-22T10:43:03+00:00">...</time>
</a>
</div>


  function add_nofollow_to_comment_metadata( $link ) {
      return str_replace( '")\'>', '")\' rel=\'nofollow\'>', $link );
  }

  add_filter( 'comment_comment_metadata', 'add_nofollow_to_comment_metadata' );

i use <?php wp_list_comments(); ?> without any customise.

You do not need to add code WordPress will automatically nofollow comment links

There is no way to modify this behavior via hooks or filters. But you can implement this by:

  1. Using get_comments function. It allows maximum customization.
  2. Extending Walker_Comment class and implementing your custom functionality.

The first option is obviously simpler.