{"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":"2020-05-24T11:04:30","modified_gmt":"2020-05-24T05:34:30","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 All Links in WordPress Comments"},"content":{"rendered":"<p>How can you<strong> remove spam links<\/strong> from your WordPress comments text? If you get thousands of spam comments everyday, even with <a title=\"Use GASP to Stop WordPress Spam Comments Instantly\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2012\/11\/how-gasp-stops-wordpress-spam-comments\/\">anti-spam comment tools<\/a>, \u00a0there is a chance that many spam comments were able to get posted and had malicious links to spam websites. <a title=\"How to Moderate WordPress Comments Very Quickly\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/moderate-wordpress-comments-quickly\/\">Editing thousands of comments<\/a> is a tedious task.<\/p>\n<p>As <a title=\"How Google Made Link Removal a Big Business\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/08\/how-google-made-link-removal-a-big-business\/\">link removal requests<\/a> get more common due to multiple Google penalties and webmasters <a title=\"Find Toxic Backlinks with Link Detox\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2013\/04\/find-toxic-backlinks-link-detox\/\">find bad links<\/a> pointing from your site, there is a high chance they will request link removal or add your site to the <a title=\"Use Google Disavow Links Tool to Clean Bad Backlinks\" href=\"https:\/\/www.quickonlinetips.com\/archives\/2012\/10\/google-disavow-links-tool-cleans-bad-backlinks\/\">disavow tool<\/a>.<\/p>\n<p>I always wanted a way to bulk remove such links from all my WordPress comments &#8230; and I just did this with a single line of code.<\/p>\n<h3>WordPress Makes Links\u00a0Clickable<\/h3>\n<p>For example, lets see this link posted in a comment. [Please note this particular comment is shown as an example only and the comment link is not spam]<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35003\" style=\"border: 1px solid black;\" alt=\"clickable link\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/clickable-link.png\" width=\"337\" height=\"125\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/clickable-link.png 337w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/clickable-link-150x55.png 150w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/clickable-link-300x111.png 300w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/clickable-link-270x100.png 270w\" sizes=\"(max-width: 337px) 100vw, 337px\" \/><\/p>\n<p>If you actually see the comment in the Edit screen, there was no clickable complete url.<\/p>\n<p><img decoding=\"async\" class=\"alignnone size-full wp-image-35012\" style=\"border: 1px solid black;\" alt=\"Edit Link\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-link.png\" width=\"488\" height=\"126\" srcset=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-link.png 488w, https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/edit-link-300x77.png 300w\" sizes=\"(max-width: 488px) 100vw, 488px\" \/><\/p>\n<p>In fact it is a cool feature of\u00a0WordPress that makes a\u00a0<a href=\"https:\/\/codex.wordpress.org\/Function_Reference\/make_clickable\" target=\"_blank\" rel=\"noopener noreferrer\">text link clickable<\/a>\u00a0in this comment.<\/p>\n<h3>Removing Comment Links<\/h3>\n<p>So here is what I did. I added this single line of code to the theme <em>functions.php<\/em> file. [Be careful when you edit this important file in your themes editor, as wrong edits can take your blog offline &#8211; keep a backup and restore via FTP if needed]<\/p>\n<p><code>remove_filter('comment_text', 'make_clickable', 9);<\/code><\/p>\n<p>This disables the ability of WordPress to makes all these links clickable <em>in the comments text<\/em>. And now when you see the same comments after using this code, you see the clickable links are gone!<\/p>\n<p><img decoding=\"async\" style=\"border: 1px solid black;\" alt=\"text link\" src=\"https:\/\/www.quickonlinetips.com\/archives\/wp-content\/uploads\/text-link.png\" width=\"411\" height=\"125\" \/><\/p>\n<p>NOTE: This will affect remove ALL links (spam and not spam) in comments text only (not comment author links) \u00a0on your whole blog. The links will become non clickable, but would stay as text links. This would mean effectively thousands of published spam links will disappear instantly! Try it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>How can you remove spam links from your WordPress comments text? If you get thousands of spam comments everyday, even&#8230;<\/p>\n","protected":false},"author":4,"featured_media":35003,"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":0,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/posts\/35002\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.quickonlinetips.com\/archives\/wp-json\/wp\/v2\/media\/35003"}],"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}]}}