A WordPress comment section full of random clickable links can make your website look suspicious.
For many site owners, that’s where the trouble starts. Spammers abuse it, search engines may flag it, and even genuine comments with useful links can end up looking suspicious.
At WPBeginner, we usually mark these comments as spam, but we know that’s not the best solution for everyone.
After thorough research, we’ve found a simple way to block auto-linking of URLs while keeping real conversations flowing. 💬
In this guide, we’ll show you how to disable automatic URL linking in WordPress comments. This way, you have more control over your comment section while still encouraging meaningful engagement.

Why Does WordPress Autolink Text URLs in Comments?
WordPress autolinks text URLs in comments to make them easier to click. This is meant as a convenience feature, so site owners and readers can visit links without copying and pasting.
Sometimes, these links are added by genuine commenters who don’t know how to format a hyperlink.
WordPress simply detects the URL and makes it clickable when showing the comment in the admin area or under your articles. Plus, it’s not actually stored that way in your database.

The problem is, spammers abuse this to drop shady links in your comments. This can make your WordPress website look untrustworthy to both readers and search engines.
That’s why many site owners prefer to disable auto-linking.
With that in mind, we will show you how to disable auto-links of URLs in WordPress comments. Here are the steps you’ll take:
- Installing a WordPress Plugin to Disable URL Auto-Links
- Disabling Auto-Links of URLs in WordPress Comments
- FAQs: Disabling URL Auto-Linking in WordPress Comments
Easy, right? Let’s jump right in!
Step 1: Installing a WordPress Plugin to Disable URL Auto-Links
Before we start, do note that many WordPress experts will tell you to add a custom line of code to your theme’s functions.php file or in a site-specific plugin.
However, we don’t recommend this method as it’s not really beginner-friendly. One tiny mistake, and your site might stop working.
To do this easily and safely, you can use WPCode, which is the best code snippet plugin on the market. With WPCode, you can add custom code snippets, including CSS, PHP, HTML, and more, to WordPress without putting your site at risk.
Some of our partner brands use WPCode to create and manage custom code snippets, and it’s been working really well. Don’t miss our detailed WPCode review to learn why we strongly recommend it.
The best news is that WPCode comes with a library of 100+ ready-made snippets that you can easily add to your site. This includes a code snippet for disabling comment URL linking.
Since it’s a premium feature, you’ll need to create a WPCode account. On the WPCode website, go ahead and click the ‘Get WPCode Now’ button.
Then, you can simply choose a plan and complete the sign-up process.

Once done, let’s install and activate the WPCode plugin on your WordPress site. If you need help, then you can refer to our guide on how to install a WordPress plugin.
Upon activation, you’ll need to activate your license key. To do this, you’ll navigate to Code Snippets » Settings.
Next, under the ‘General Settings’ tab, simply enter your license key and click ‘Verify Key.’ You can find this key in the email you receive after registration or in your WPCode account.

Step 2: Disabling Auto-Links of URLs in WordPress Comments
The next step is to go to Code Snippets » + Add Snippets from your WordPress admin dashboard.
From here, you’ll want to use the ‘Comments’ filter to easily find the ‘Disable Comment URL Linking’ snippet. Then, you can hover over the snippet and click on the ‘Connect to library to unlock (Free)’ button.

On the popup that appears, go ahead and click ‘Connect to WordPress.’
Once connected, you should then be ready to use the ‘Disable Comment URL Linking’ snippet. So, let’s hover over it again and click ‘Use snippet’ when it appears.

This will redirect you to the WPCode code editor.
Since the code snippet is ready to use, you just need to switch the toggle from ‘Inactive’ to ‘Active’ and click the ‘Save Snippet’ button.

⚠️ Important: Please note that this code only works on plain text URLs. If a user decides to create a link by adding the proper HTML tag, then those links will still appear clickable.
If you want to completely turn off any HTML in comments, then you can take a look at our tutorial on how to disable HTML in WordPress comments.
And that’s it – your WordPress blog will now stop auto-linking URLs in comments.
Here’s what it looks like on our demo site:

Bonus: Explaining the Code Snippet to Disable Auto-Linking in Comments
If you’re curious, here’s the code snippet we used for disabling auto-links of URLs in WordPress comments:
remove_filter( 'comment_text', 'make_clickable', 9 );
This snippet works because WordPress doesn’t store URLs as clickable links in its database.
Instead, it converts plain text URLs into clickable links on the fly when displaying comments.
By disabling the filter responsible for this, you stop URLs from automatically becoming clickable. This change will affect both the admin area and the comments section below your posts.
If you remove the snippet later, WordPress will start auto-linking URLs again.
This risk of losing your customizations during a theme update is exactly why we recommend using a plugin like WPCode. It stores your snippets separately from your theme files, so you never have to worry about updates breaking your site’s custom features.
FAQs: Disabling URL Auto-Linking in WordPress Comments
Will disabling auto-linking remove links from my existing comments?
No, this change only applies going forward.
It stops WordPress from automatically converting plain text URLs into clickable links in any new comments you get. Links that were already in your older comments will remain clickable unless you decide to edit them manually.
Can users still add their own links in comments?
Yes. This code only disables the automatic conversion of text URLs. If a commenter knows how to create a link using the proper HTML tag, that link will still appear in their comment.
Is this change reversible?
Yes, it is completely reversible. If you use the WPCode plugin as we recommend, you can simply toggle the snippet to ‘Inactive’ and save your changes. WordPress will immediately go back to auto-linking URLs.
Does this snippet affect links in my blog posts or pages?
Not at all. The code snippet we use is designed to target only the comments filter. It will have no effect on how links work inside your post or page content.
Further Reading: More Ways to Improve Your WordPress Comments
We hope this article helped you disable the auto-linking of URLs in WordPress comments.
If you want to improve your WordPress comments even more, check out these additional tutorials for more tips and tricks:
- How to Get More Comments on Your WordPress Blog Posts
- How to Allow Users to Like or Dislike Comments in WordPress
- How to Allow Users to Upload Images in WordPress Comments
- How to Allow Users to Edit Their WordPress Comments
- How to Add a Simple User Ranking System for WordPress Comments
- How to Make Blog Post Comments Searchable in WordPress
- How to Highlight Author’s Comments in WordPress
- How to Export Email Addresses from WordPress Comments
If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Facebook.


Deniz
Thanks for the guide. I added the code to function.php and it worked. So is there a way to exclude my own links from this?
WPBeginner Support
We do not have a simple way at the moment but should we find a way we would recommend we will be sure to update the article!
Admin
Febri Tri Harmoko
How to make except like our domain?
So, only link from our website can add.
WPBeginner Support
At the moment we do not have a method to limit by domain.
Admin
Pasquale
Thanks, this was helpful. I was getting a lot of comments like ‘your website is great…bla bla…check mine’ and a link. Hopefully this will fix it
WPBeginner Support
Glad our guide was helpful
Admin
Geospatial &Space Technology
Thank you for this
WPBeginner Support
You’re welcome
Admin
Abdulrahim safi
Hello How can i disable auto link in posts not comments
when i enter a link in text format ex: http://www.example.com it is automatically changed to hyperlink when i publish post how can i disable this thanks
WPBeginner Support
Abdulrahim Saifi,
WordPress doesn’t automatically convert URLs into links. You are probably using WordPress.com. Please see our guide on the difference between self hosted WordPress.org vs free WordPress.com blog.
Admin
Liz
Do you guys have a similar solution for posts? Especially in code and pre blocks?
Kemunto
Yes.
Sunny
Is there a plugin to un-link some certain external text link on WordPress site? Thanks
Sebastien
Hello. I’m looking for a way to do just what you mentioned, but only for posts. It seems with a recent WP update, if you type a website address in a post, WP will automatically link to it. For example, if your post contains “google.com” somewhere in the post, then WP will add a link to google. Can we stop that from happening? If so, how? Thank you
Bobby
Hey Sebastien did you find the solution for your problem as i am also having problem with this.. and i just want to get it disabled.. thanks
StageCoachDriver
Could the functions.php in a child theme be used to add ‘remove_filter( ‘comment_text’, ‘make_clickable’, 9 );’ to the theme rather than making changes directly to the theme?
WPBeginner Support
Yes.
Admin
Angel
That is really good. In my case, I’ll make a conditional to make my links – as admin – clickable, since I post them on replies to comments.
Thanks
Matteo
Hi Angel,
do you mind posting here the code you wrote? I’m interested in having my own links (as admin) cliackable
Thank you
Angel
As I am the only person show logs in I am able to use:
if ( is_user_logged_in() ) {
remove_filter( ‘comment_text’, ‘make_clickable’, 9 );
}
Ibon Azkoitia
Maybe I’m wrong about your situation, but you should not write in your Blog with an Admin User. The “Writer” should have a lower role (editor for example) and have another user with the Admin role for admin stuff.
Iswandi
It works after I remove the quotation marks at the ‘make_clickable’