Title: Remove comment author&#039;s link
Last modified: August 22, 2016

---

# Remove comment author's link

 *  [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/)
 * I wish to remove, disable or hide the comment authors’ links to their sites from
   my home page. The WordPress plug-ins for this purpose I have found on this website
   do not seem compatible with WP 4.0. I have found all kinds of different codes
   on this website to enter in different files like functions.php and comment.php
   but am very reluctant to do it lest I break my website. Kindly let me know whether
   you can help me with very clear step-by-step instructions that you have tested
   on your own website. . Thank you very much.

Viewing 11 replies - 1 through 11 (of 11 total)

 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379284)
 * you will possibly need to edit either commments.php or functions.php of your 
   theme.
 * details will depend on your currently used theme
    – please post the name and 
   download link of your theme.
 * [http://codex.wordpress.org/Forum_Welcome#Include_as_much_information_as_possible](http://codex.wordpress.org/Forum_Welcome#Include_as_much_information_as_possible)
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379292)
 * The name of the theme is Twenty Twelve.
    Its download link is [https://wordpress.org/themes/twentytwelve](https://wordpress.org/themes/twentytwelve)
   Thanks.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379318)
 * are you referring to the links in the ‘recent comments’ widget on your front 
   page?
 * do you want to keep te comment authors’ names?
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379320)
 * The answers are yes and yes, but I want to disable their links to their own sites.
   
   Thanks!
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379336)
 * start by backing-up your site; [http://codex.wordpress.org/WordPress_Backups](http://codex.wordpress.org/WordPress_Backups)
 * then create a child theme of Twenty Twelve;
    [http://codex.wordpress.org/Child_Themes](http://codex.wordpress.org/Child_Themes)
   or download one from [http://quirm.net/themes/twenty-twelve-child/](http://quirm.net/themes/twenty-twelve-child/)
 * you will need to re-create any previously done customizations for instance of
   the header and the menu.
 * create a **functions.php** file in the child theme (if you downloaded the child
   theme, then it will already contain a functions.php which you will need to edit);
 * in your own empty functions.php, add absolutely at the start (nothing before 
   that):
    `<?php`
 * (this line is already in the downloaded functions.php)
 * then add:
 *     ```
       add_filter( 'get_comment_author_link', 'remove_html_link_tag_from_comment_author_link' );
       function remove_html_link_tag_from_comment_author_link ( $link ) {
       if( !in_the_loop() ) $link = preg_replace('/<a href=[\",\'](.*?)[\",\']>(.*?)<\/a>/', "\\2", $link);
       return $link;
       }
       ```
   
 * if you have done everything right, then the comment author links to their websites
   should be gone from the ‘recent comments’ widget.
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379342)
 * Many thanks, “alchymyth”. This looks like rocket science to me 🙂 I much prefer
   using plug-ins to code-editing PHP files. Is there a simple and easy WordPress
   plug-in for backing up my website, and another one for creating the child theme
   you suggest? And why is the child theme even necessary? Why not add the code 
   above to the beginning of the functions.php file in my host’s cPanel File Manager?
   Thanks again.
 *  [Julien Klepatch](https://wordpress.org/support/users/julien-klepatch/)
 * (@julien-klepatch)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379360)
 * For your website backup, you can use this plugin:
    [https://wordpress.org/plugins/duplicator/](https://wordpress.org/plugins/duplicator/)
 * For the child theme, this is not difficult. /
    1) create a folder twentytwelve-
   child in wp-content/themes/ 2) create a file style.css in the twentytwelve-child
   folder and copy this at the top: /* Theme Name: Twenty Twelve Child */ 4) create
   a file function.php in the twentytwelve-child folder and add the snippet that
   alchymyth gave you.
 * Finally, why a child theme ? It allows you to add your customizations while still
   being able to update your parent theme in the future. Otherwise, if you customize
   directly the original theme and if you decide to update this theme in the future,
   you will loose your customizations
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379369)
 * Hello Julien. I can’t tell you how much I appreciate your clear, detailed, step-
   by-step instructions. However, I have done everything you and alchymyth have 
   told me, and, unfortunately, as you can see on my website [http://avner-falk.net](http://avner-falk.net)
   the comment authors’ links to their own websites are still there in the “Recent
   comments” widget. You seem to know your stuff, so if you have any other ideas,
   I shall be more than happy to try them out. I can also call you if you have some
   free time and let me have your phone number by e-mailing me to _[email moderated–
   the forum does not provide support via email]_ Thanks again.
 *  [Michael](https://wordpress.org/support/users/alchymyth/)
 * (@alchymyth)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379384)
 * right now, the site is still using the parent theme Twenty Twelve;
 * did you ever activate the child theme?
 * or did you try the suggested filter code directly in functions.php of the Twenty
   Twelve theme?
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379404)
 * I could not activate the child theme because the style.css file was missing the
   Template line and therefore that theme was shown as broken in the my Themes folder.
 * I have inserted the Template line. Now, however, if I activate the child theme,
   the links to the comment authors’ sites are inactive, but they are still displayed
   as hyperlinks. Moreover, the child theme is lacking all the features of the parent
   theme. It seems I need to import those features using wp_enqueue_style but I 
   don’t know where and how to do so. I would greatly appreciate your assistance
   to complete the solution.
 * Thank you very much.
 *  Thread Starter [groucho43](https://wordpress.org/support/users/groucho7/)
 * (@groucho7)
 * [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379434)
 * Hello again,
 * I hope you are having a nice weekend.
 * I am still patiently waiting to learn how to import the attributes of the parent
   theme (twentytwelve) into the child theme (twentytwelve-child). In the meantime
   I have run into an additional problem: how to make all the hyperlinks on my website
   blue. I have used all sorts of plug-ins and CSS codes that either did not solve
   the problem or created new ones. As I am a real novice to WordPress, any assistance
   you may care to provide will be very much appreciated, but please do not go out
   of your way to reply and. above all, enjoy your weekend.
 * Thanks again.

Viewing 11 replies - 1 through 11 (of 11 total)

The topic ‘Remove comment author's link’ is closed to new replies.

## Tags

 * [author](https://wordpress.org/support/topic-tag/author/)
 * [commnet](https://wordpress.org/support/topic-tag/commnet/)
 * [link](https://wordpress.org/support/topic-tag/link/)
 * [remove](https://wordpress.org/support/topic-tag/remove/)
 * [url](https://wordpress.org/support/topic-tag/url/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 11 replies
 * 3 participants
 * Last reply from: [groucho43](https://wordpress.org/support/users/groucho7/)
 * Last activity: [11 years, 6 months ago](https://wordpress.org/support/topic/remove-comment-authors-link/#post-5379434)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
