How to Remove the WordPress Comment Author Link

Table of Contents

Sponsored Ad

If you purchase through a link on our site, we may earn a commission.

An active comments section is a huge SEO advantage, but in certain cases, it’s better for your site’s SEO if you remove the WordPress comment author link. Black Hat SEO operators use sophisticated systems to drop their spammy links on unsuspecting websites. Don’t allow these ruthless operators to use the built-in WordPress comments functionality to steal your SEO link juice!

So, how could the WordPress comment author link possibly be a problem?

Let’s first clarify what the issues are, how they work, and how serious they can become. Then, we’ll describe how you can manage spammy website links. After that, we’ll provide instructions for both cosmetic and more permanent ways to remove the WordPress comment author link.

The cosmetic solution just suppresses the display of the WordPress comment author link. The link is still there but does not get shown. The nuclear option completely removes the URL field from the WordPress comment form, so comment author links would never exist.

The WordPress default setting enables comment abuse

The WordPress default setting is kinder to spam terrorists than to real users. The website URL field, which becomes the comment author link, is the most common source of WordPress spam.

It allows anyone with a valid email address to leave a comment. Theoretically, this allows people to leave comments without exposing their identity.

On the one hand, this could improve user engagement. People can comment without fear of identification or harassment for holding a contrarian opinion. In practice, this anonymity is an opportunity for spammers. 

Fortunately, also by WordPress default, this link has a no-follow attribute. It’s a signal to search engines that they should not follow the links in individual comments.

How bad can comment abuse get?

A high percentage of users write online comments with the sole intention of sneaking in their website link (URL). It’s such an easy way to get a backlink from authoritative websites! 

That β€œbad” SEO juice can sink a new or struggling website. It can negate all the good work you do in other SEO aspects. Those juice-leaching links indicate to Google that your site needs improvement. It signals that your site is not a top-rated authority, no matter your industry.

Annoying or harmful comments could also deter bona fide visitors. To add insult to injury, if your visitors click on author links it diverts them away from your site. The point of creating great content is to get visitors to stick around and interact with you!

A further concern for sites on cheaper, limited hosting plans is that the increased traffic from bots could gobble up your traffic and bandwidth allocation pretty quickly. 

The solution is to block juice-hijacking spam from appearing on your WordPress site, but accept comments from real users.

Ways to control spam comments in WordPress

The list of built-in WordPress tools to do this are:

  • IP Blocking: A never-ending manual task against spambots with enormous resources and endless new IPs.
  • Filter or exclude certain words: Go to Settings >> Discussion Settings >> Disallowed Comment Keys.
  • Force users to register before they comment: Go to Settings >> Discussion Settings >> Other comment settings. Check both β€œComment author must fill out name and email” and β€œUsers must be registered and logged in to comment”.
  • Disable comments for the entire site: Go to Settings >> Discussion Settings >> Default post settings. Uncheck β€œAllow people to submit comments on new posts”.
  • Disable comments for a specific post. While editing or creating a page, click on the Settings icon. Go to Page settings >> Discussion tab. Check the β€œAllow comments” box.
  • Hold all comments for moderation and manual approval: An impossible task if you have a busy site. Go to Settings >> Discussion Settings >> Before a comment appears >> β€œComment must be manually approved”.
  • Enable β€œComment author must have a previously approved comment” to lighten the spam control load. However, that setting will only work if you have enabled cookies for saving the commenter’s name, email, and website to make future commenting faster. 
  • Check the enable/disable cookies setting near the top of the page Settings > Discussion Settings >> Other comment settings. Uncheck the β€œshow comments cookies opt-in checkbox, allowing comment author cookies to be set”. If you uncheck this option it will force spammers to re-register every time, however, it may irritate bona fide users.
  • The setting β€œHold the comment for moderation if it contains X number of hyperlinks” is not very effective in this particular case because the spam link originates from the URL field of the standard comment form. You can inhibit the more opportunistic spammers somewhat. Go to Settings >> Discussion Settings >> Comment moderation >> β€œHold a comment in the queue if it contains β€œx or more links”. The WordPress default setting is 2, but we suggest you change this to 1.
  • Filter comments with spam-fighting plugins like Akismet.
  • Add a Captcha to your comment form to knock out spam bots in the first round. It could add a boundary between you and bona fide users but it’s a valuable function on a high-traffic site.

These built-in tools will simply inconvenience determined spammers. Unless you remove the website URL text box from the standard WordPress comment form, you’ll always be on spam patrol. Additionally, the offending website URL will still sit on the backend of your website (see Image 1), where it could influence SEO to a small degree.

comment_author_link_on_wordpress
Image 1: The website URL will be saved and visible on your backend, though not visible to visitors to your site.

Top tips before you start

In some cases (we’ve specified the details below), disabling the comment author link won’t remove existing comment author links everywhere on the site. You’ll have to clean up the old comments manually.

Also, during our research for this tutorial, we came across a few guides that recommend, for various reasons, that you change the default no-follow attribute to do-follow. We highly disagree with this advice. Rather use one of the many other ways to retroactively remove comment author links across your site that we’ve listed below. 

Read on for our list of ways to implement either a cosmetic solution or the β€œnuclear option” to prevent and remove spammy author links.

There are several ways to prohibit the display (disabling or hiding) of the website URL field on published comments. Hiding those links will make your comments section more attractive, but the website URL link will still sit on the WordPress backend. These links greatly increase the number of your internal no-follow links, which could influence your SEO to a small degree

Remove them using either one of the automated methods below or by hand. You can use an advanced SEO tool like SEMRush or Yoast for help to identify all remaining internal no-follow links. 

Cosmetic option 1: Free plugin to block the display of the comment author link

The free “Hide Comment Author Link” comes widely recommended by several plugin review sites. However, the creator has not updated it for a while, which, to us, is a cause for concern. It does not remove the website URL field, just disables the comment author link so that links won’t be publicly visible. 

Alternatively, you could consider the free version of Comment Link Remove and Other Comment Tools. The premium option removes the URL field (similar to the PerfMatters plugin below), plus offers additional functions.

Cosmetic option 2: Block display of the comment author URL link via functions.php 

We highly recommend using a plugin to alter functions.php. Editing the functions in your theme’s functions.php file should be left to advanced users doing it for very specific reasons. You can use the snippet below in the recommended Code Snippets plugin as shown in Image 2:

add_filter( 'get_comment_author_link', 'remove_comment_author_link', 10, 3 );
  function remove_comment_author_link( $return, $author, $comment_ID ) {
    return $author;
}
comment_author_URL_removed_Code_Snippets_plugin
Image 2: Block display of the comment author URL link via functions.php using the Code Snippets plugin

Note: The website URL field will still be visible on the standard WordPress comment form. If the visitor completes the field, the URL will be visible to a WordPress administrator as can be seen in Image 3. The comment author links will be removed from both new, and existing comments as can be seen in Image 4.

URL_field_visible_on_form_only_visible_to_moderator
Image 3: The website URL field will still be visible on the standard WordPress comment form. If the visitor completes the field, the URL will be visible to a WordPress administrator as can be seen in this image.

With this method, the comment author links will be removed from new and existing comments (see Image 4).

URL_field_appears_but_comment_author_link_removed
Image 4: Even though the URL field still appears on your comment form, the comment author links will be removed from both new and existing comments and will not be visible to website visitors.

The nuclear option: Remove the website URL field from the WordPress comment form 

Nuclear option 1: Block display of the URL field in the WordPress comments form via CSS

WordPress uses the class comment-form-URL to display the author’s website URL on the standard WordPress comment form. You can modify this class by adding site-wide CSS to your theme’s appearance settings as shown in image 5: 

Go to: Appearance >> Themes >> Customize >> Additional CSS. Copy the following and paste it into the CSS block:

.comment-form-url{
  display:none;
}
remove_wordpress_comment_author_link_via_CSS
Image 5: Add site-wide CSS to your theme’s appearance settings

Note: This CSS blocks the website URL field on the standard WordPress comment form. The comment author cannot provide a website URL, so WordPress won’t create a comment author link. 

What makes this option different is that the website URL field will still be visible (even though empty). An administrator can edit the comment from the WordPress end. This is a good option if you want to allow hand-picked backlinks, though you will have to insert the website URL yourself during moderation. Existing comments elsewhere on the website will remain unchanged. You will still have to clean up other spam links by hand.

Nuclear option 2: Use a plugin to remove the URL field from the WordPress form

There is an increasing tendency to bundle several functions into a single offering, for example, bundled plugins built to harmonize all performance metrics.

The Perfmatters optimization plugin removes unnecessary WordPress functions like unused WooCommerce styles/JS, feeds, XML-RPC, and other items. 

Do a standard plugin installation and activation. Navigate to β€œSettings >> Perfmatters menu >> Options >> General. Scroll down. Enable the β€œRemove Comments URLs” option and save.

Note: The PerfMatters plugin removes the website URL field from the standard WordPress comments form and removes links from all existing comments. What makes this option different is that you can switch it on or off by simply checking/unchecking a field in the plugin settings.

Nuclear option 3: Remove the URL field from the WordPress comment form using a code snippet

We do not recommend editing functions in your theme’s functions.php file. We recommend that you use the Code Snippets plugin as can be seen in Image 6, using this snippet: 

add_filter('comment_form_default_fields', 'unset_url_field');
  function unset_url_field($fields){
    if(isset($fields['url']))
      unset($fields['url']);
      return $fields;
}
Image-6 remove_comment_author_link_via_code_snippets_plugin
Image 6: Remove WordPress comment author link via Code Snippets plugin

Note: The website URL field will not appear on the standard WordPress comment form anymore, so WordPress won’t create a comment author link. However, the URL field will still be visible (even though empty) if an administrator wants to edit the comment during moderation. Existing comments elsewhere on the website will remain unchanged.

As mentioned earlier, this is a good option if you want to allow hand-picked backlinks. You will have to insert the website URL yourself during moderation. Remember that existing comments elsewhere on the website will remain unchanged, so you will have to clean up all the spam links by hand.

Conclusion

The presence of a website URL in the comments form is the single largest source of spam on WordPress sites. Although there is no default setting to disable comment author linking or remove website URLs for WordPress comment forms, there are several other safe, easy ways to prevent spammers from hijacking your link juice.  

Spammy comments can be highly detrimental to your website ranking. We recommend that you take the fight to heart right from the start.

Adeline is a computer technology, alternative energy, and IoT enthusiast with a knack for turning highly technical subjects into fascinating, short reads for non-experts.

Sponsored Ad

If you purchase through a link on our site, we may earn a commission.

All suggestions are anonymous.

More from our blog...

Post a Comment

Your email address will not be published. Required fields are marked *

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

Stay updated with WP Mayor's newsletter showcase every week

Stay on top of every new WordPress innovation and latest launches. Receive all our fresh product reviews and expert guides directly in your inbox.

Hosting Survey 2024

Are you happy with your hosting provider or are you over-paying for too little? Have your say below!

"*" indicates required fields

What's the main reason you picked this host?*
How happy are you with your host?*

OPTIONAL: If you'd like to receive the results of this survey, please enter your details below.