{"id":35002,"date":"2013-08-29T21:51:47","date_gmt":"2013-08-29T16:21:47","guid":{"rendered":"https:\/\/www.quickonlinetips.com\/archives\/?p=35002"},"modified":"2026-10-13T13:42:28","modified_gmt":"2026-10-13T08:12:28","slug":"remove-spam-links-in-wordpress-comments","status":"publish","type":"post","link":"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/","title":{"rendered":"How to Remove Links in WordPress Comments (Stop Clickable Spam Links)"},"content":{"rendered":"<p>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&#8217;s how to <strong>remove links in WordPress comments<\/strong>, plus a few extra options.<\/p>\n<p><img decoding=\"async\" class=\"aligncenter size-large wp-image-64797\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments-1024x538.webp\" alt=\"Remove links in WordPress comments\" width=\"1024\" height=\"538\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments-1024x538.webp 1024w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments-300x158.webp 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments-150x79.webp 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments-768x403.webp 768w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/remove-links-wordpress-comments.webp 1200w\" sizes=\"(max-width: 1024px) 100vw, 1024px\" \/><\/p>\n<p><strong>Quick answer:<\/strong> Add <code>remove_filter('comment_text', 'make_clickable', 9);<\/code> to your theme&#8217;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.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_89 counter-hierarchy ez-toc-counter ez-toc-custom ez-toc-container-direction\">\n<p class=\"ez-toc-title\" style=\"cursor:inherit\">Table of Contents<\/p>\n<label for=\"ez-toc-cssicon-toggle-item-6af4e35b68f23\" class=\"ez-toc-cssicon-toggle-label\"><span class=\"ez-toc-cssicon\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #1a202c;color:#1a202c\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #1a202c;color:#1a202c\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/label><input type=\"checkbox\"  id=\"ez-toc-cssicon-toggle-item-6af4e35b68f23\" checked aria-label=\"Toggle\" \/><nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#1_Remove_links_in_WordPress_comments_text_stop_auto-linking\" >1. Remove links in WordPress comments text (stop auto-linking)<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#2_Remove_the_Website_field_from_the_comment_form\" >2. Remove the Website field from the comment form<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#3_Remove_existing_author_links\" >3. Remove existing author links<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#4_Strip_HTML_links_from_comment_text\" >4. Strip HTML links from comment text<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#Keep_it_safe\" >Keep it safe<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#FAQ\" >FAQ<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#Does_removing_comment_links_help_SEO\" >Does removing comment links help SEO?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#Will_this_delete_any_comments\" >Will this delete any comments?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/remove-spam-links-in-wordpress-comments\/#Can_I_allow_links_from_trusted_commenters\" >Can I allow links from trusted commenters?<\/a><\/li><\/ul><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"1_Remove_links_in_WordPress_comments_text_stop_auto-linking\"><\/span>1. Remove links in WordPress comments text (stop auto-linking)<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>remove_filter('comment_text', 'make_clickable', 9);<\/code><\/pre>\n<p>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 <a href=\"https:\/\/developer.wordpress.org\/reference\/functions\/make_clickable\/\" rel=\"noopener\" target=\"_blank\">make_clickable() reference<\/a> for details.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"2_Remove_the_Website_field_from_the_comment_form\"><\/span>2. Remove the Website field from the comment form<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>add_filter('comment_form_default_fields', function ($fields) {\n  unset($fields['url']);\n  return $fields;\n});<\/code><\/pre>\n<p>Spammers lose their main reason to comment: a link to their site.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"3_Remove_existing_author_links\"><\/span>3. Remove existing author links<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<pre><code>add_filter('get_comment_author_url', '__return_empty_string');<\/code><\/pre>\n<p>Author names display without links, including on old comments.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"4_Strip_HTML_links_from_comment_text\"><\/span>4. Strip HTML links from comment text<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Commenters can still type &lt;a&gt; tags. A plugin or a <code>pre_comment_content<\/code> filter can strip them, and moderation rules can hold any comment with links (Settings &gt; Discussion &gt; hold comments with 1 or more links).<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Keep_it_safe\"><\/span>Keep it safe<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<ul>\n<li>Use a child theme or a code snippets plugin so updates don&#8217;t remove your code.<\/li>\n<li>Keep a backup and FTP access in case of a typo.<\/li>\n<li>WordPress already adds rel=&#8221;nofollow ugc&#8221; to comment links, but spam can still hurt readers.<\/li>\n<\/ul>\n<p>More spam defences: <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2014\/09\/4-best-wordpress-plugins-to-stop-comment-spam\/\">best plugins to stop comment spam<\/a>, <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2008\/12\/ban-ip-to-stop-wordpress-comment-spam-forever\/\">ban spammer IPs<\/a> and <a href=\"https:\/\/www.quickonlinetips.com\/archives\/2006\/10\/automatically-close-comments-in-wordpress-after-few-days\/\">close comments on old posts automatically<\/a>.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"FAQ\"><\/span>FAQ<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"Does_removing_comment_links_help_SEO\"><\/span>Does removing comment links help SEO?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>It reduces spammy outbound links and makes your site less attractive to spammers.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Will_this_delete_any_comments\"><\/span>Will this delete any comments?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>No. Comments stay; only links are disabled.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_allow_links_from_trusted_commenters\"><\/span>Can I allow links from trusted commenters?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>Not with these simple filters; you&#8217;d need a plugin with role-based rules.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In 2013 I noticed that even comments with plain-text URLs showed up as clickable links on QuickOnlineTips, because WordPress automatically&#8230;<\/p>\n","protected":false},"author":4,"featured_media":64797,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_kad_post_transparent":"","_kad_post_title":"","_kad_post_layout":"","_kad_post_sidebar_id":"","_kad_post_content_style":"","_kad_post_vertical_padding":"","_kad_post_feature":"","_kad_post_feature_position":"","_kad_post_header":false,"_kad_post_footer":false,"_kad_post_classname":"","footnotes":""},"categories":[6,41],"tags":[17],"class_list":["post-35002","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blogging","category-search-engine-optimization","tag-wordpress"],"_links":{"self":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/35002","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/users\/4"}],"replies":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/comments?post=35002"}],"version-history":[{"count":3,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/35002\/revisions"}],"predecessor-version":[{"id":65496,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/35002\/revisions\/65496"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/64797"}],"wp:attachment":[{"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media?parent=35002"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/categories?post=35002"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/tags?post=35002"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}