How to Remove Links in WordPress Comments (Stop Clickable Spam Links)
In 2013 I noticed that even comments with plain-text URLs showed up as clickable links on QuickOnlineTips, because WordPress automatically turns web addresses into links. One line of code in functions.php made thousands of published spam links unclickable instantly. It still works in 2026. Here’s how to remove links in WordPress comments, plus a few extra options.

Quick answer: Add remove_filter('comment_text', 'make_clickable', 9); to your theme’s functions.php or a code snippets plugin to stop WordPress auto-linking URLs typed in comments. To remove the Website field and author links too, use the small filters below or an anti-spam plugin that strips links. Back up before editing code.
Table of Contents
1. Remove links in WordPress comments text (stop auto-linking)
remove_filter('comment_text', 'make_clickable', 9);URLs stay visible as plain text but are no longer clickable. This affects all comments, spam or not, but not the comment author link. See the make_clickable() reference (external site) for details.
2. Remove the Website field from the comment form
add_filter('comment_form_default_fields', function ($fields) {
unset($fields['url']);
return $fields;
});Spammers lose their main reason to comment: a link to their site.
3. Remove existing author links
add_filter('get_comment_author_url', '__return_empty_string');Author names display without links, including on old comments.
4. Strip HTML links from comment text
Commenters can still type <a> tags. A plugin or a pre_comment_content filter can strip them, and moderation rules can hold any comment with links (Settings > Discussion > hold comments with 1 or more links).
Keep it safe
- Use a child theme or a code snippets plugin so updates don’t remove your code.
- Keep a backup and FTP access in case of a typo.
- WordPress already adds rel=”nofollow ugc” to comment links, but spam can still hurt readers.
More spam defences: best plugins to stop comment spam, ban spammer IPs and close comments on old posts automatically.
FAQ
Does removing comment links help SEO?
It reduces spammy outbound links and makes your site less attractive to spammers.
Will this delete any comments?
No. Comments stay; only links are disabled.
Can I allow links from trusted commenters?
Not with these simple filters; you’d need a plugin with role-based rules.
Stuck on a gift? Try our free Gift Idea GeneratorIdeas for anyone by age, job, interests and budget, with Amazon.com and Amazon.in linksFind gifts →Get our free weekly email: new tech guides and tools, no spam.
New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.
One email a week. Unsubscribe anytime. See our privacy policy.







Nice tips and trick for remove spam links in WordPress Comments..
Thanks Admin for sharing this article
Have a nice day
Links are way too dangerous because you just cannot get into others’ profiles if you are planning to flag them it. They are form of advertisements that looks really suspicious. Spams are everywhere now. If you just do not know how to control them, then, your site is really doomed.
I really searching the answers about prevent spamming comments in wordpress for some days because my wordpress blog attack with lots of spamming comments everyday. I used plugins but they are not so active. Now I have found the easiest way to remove spamming comments.
I charge people for removing their links. They paid someone to spam my blog so why should I clear up their mess for free? And this “threatening me with Disavow” nonsense needs to stop as well, having your site submitted to this tool WILL NOT hurt your site.
A sure way to tackle the spammers. Thanks for this handy tip.