in Web & Tech

Hide the Comment-Reply link in Drupal 7

Often times flat comments are preferred over nested ones, which makes Drupal’s default “reply to comment”-links pretty useless, if not confusing. To get rid of them just add this preprocess function to your theme’s template.php:

function MYTHEME_preprocess_comment(&$vars) {
  unset($vars['content']['links']['comment']['#links']['comment-reply']);
}

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.

To respond on your own website, enter the URL of your response which should contain a link to this post's permalink URL. Your response will then appear (possibly after moderation) on this page. Want to update or remove your response? Update or delete your post and re-enter your post's URL again. (Learn More)