How to Remove Hyperlinks from Comment URLs?

How to Remove Hyperlinks from Comment URLs?

Spam commenting is a huge problem in today’s age for bloggers and website owners. Link spammers leave a comment in the comment section which when published get hyperlinked. The main reason behind such practices is to generate backlink which in turn increases SEO score. While Google is against these kind of link generation, this hasn’t affected spammers from using this technique. Even worse, these links can negatively affect your website’s SEO score as well.

If you’re using a CMS like WordPress, then the hyperlinks will be generated automatically if published. In this article, we’ll explain how to remove such unwanted hyperlinks.

Disable Autolinking By Modifying functions.php

As mentioned before, WordPress will hyperlink a link whenever it is published. This behavior is by default, but not permanent. You can change it. The first way to do is by working with the current installed theme. You need to make some edits in the theme files. You can either use an FTP to download the files locally and then edit the required files. Or you can also use the File Manager in cPanel. While performing edits on live sites in not recommended, we’ll be using the WordPress Editor since it is the faster method. Follow the steps mentioned below:
  • Log in to your WordPress Admin dashboard and navigate into Appearance>Editor.
  • Find the functions.php file under the Templates section.
  • Open the functions.php file. Before making any edits, we’d suggest you to make a copy so that you can always restore the codes if anything goes wrong.
  • Get to the bottom of the code and find the closing tag “?>”
  • Add the below code just before the code
  • To save, hit the “Update File” button.
This will instruct WP to not turn links in the comment section to hyperlinks.

But there’s a risk of getting back to the default setting when you update the theme. This is because new codes often replace old codes. To solve this, you should use child themes and then add the custom PHP files. This will ensure you don’t have to lose the modifications done when updating the theme.

Use a Plugin

Second way you can remove the hyperlinks is by using a plugin. Plugins are third-party codes you can install on your WP website to enhance features. Once such plugin is Comment Link Remover. This tool will allow you to remove hyperlink with few clicks. You can also hide existing comments, disable comments globally, or open comment links. You do not have to add any codes manually for this and skip the steps mentioned above.

There’s a section called “Discussions” where you can regulate your comment section. Many people wonder if they can use this section to limit the hyperlinks. But unfortunately, there’s no feature available for removing hyperlinks. At most you can do is remove those kind of comments from the Discussion section.

It’s a good idea to clean your comment section from time to time. Allow the useful comments that add value to the discussion, but it’s not worth having an unnecessary link that doesn’t add value.
First release
Last update
0.00 star(s) 0 ratings