The WordPress comment system is great, But there are some functionalities in WordPress that people often see as problems. One of them is “Auto-linking URL in comments”.
When a user adds a plain text link into their comments, WordPress automatically makes this plain text links clickable. many peoples search over the internet to disable auto-linking of text URLs in WordPress comments. In this article, we will show you how to disable the auto-linking of URLs in WordPress comments.
The WordPress comment feature is good for the visitor because it allows your website visitors to click on that URL and follow the link. But if you do not want to be disturbed by clickable links and you do not want to remove the link through comment moderation, Then this hack is for you.
Also Read:- How To Fix Syntax Error In WordPress?
Why does WordPress auto links URLs in the comments?
WordPress does that just in case if a user is posting a comment with some reference links to strengthen his opinion. WordPress automatically convert plain text URLs into clickable links which makes it easy for the comment moderator or WordPress administrator to visit the link and see what it has.
This auto-linking is not stored in your database. In addition to displaying WordPress on the screen in the admin area, the URL makes clickable in the comments section below your articles.
Some of these comments are genuine where commentators do not know how to add links to comments. But many spam comments include plain URLs in the comment text directly. Today, In this post I’m going to show you how you can disable this plain text links in WordPress comments.
Also Read:- How to Resize Images without Losing its Quality?
How to Disable Auto-Link in WordPress Comments
Step 1). As I said earlier, Disabling the auto-linking URL functionality in WordPress is very easy. To get started, open your favorite FTP client, log in to your account, and then open the file”
Step 2). Once the functions file opens, simply copy and paste the code below in the function of your WordPress theme into the PHP file. Now save the file and re-upload it.
//Disable URL Auto-Linking in WordPress Comments remove_filter( 'comment_text', 'make_clickable', 9 );
The above steps make plain text URLs non-clickable in the admin area and the comment section below your post. Deleting this code will enable auto-linking again.
If you are adding this code to your theme’s functions.php file, then updating your theme will overwrite your functions file.
Note:- This code only works on plain text URLs. If a user decides to add a proper HTML tag and create a link, then those links will appear as they need.
How to Disable Auto-Link in WordPress Comments using a Plugin
If you do not want to mess with the WordPress theme files then you do this by using No Comment Links plugin. which works the same way. To get started, Firstly you need to install the plugin like any other WordPress plugin. After installing this plugin, activate it by clicking the link “Activate plugin“.
As soon as you activate the plugin, all the previous link in the comment section will be deleted and WordPress will no longer be the auto-link URL in the comments section.
We hope this article has helped you disable the auto link of the URL in WordPress comments. If you have any questions about this post, feel free to post them in the comments section below.
- What is Google RankBrain and How Does it Affect Your SERP Rankings?
- Top 20 Most Expensive Google Ads (AdWords) Keywords.
- How Much Money You Can Earn From Google AdSense.