{"id":112241,"date":"2013-03-26T17:16:59","date_gmt":"2013-03-26T21:16:59","guid":{"rendered":"http:\/\/wpmu.org\/?p=112241"},"modified":"2013-06-13T20:53:58","modified_gmt":"2013-06-14T00:53:58","slug":"remove-wordpress-comments-url","status":"publish","type":"post","link":"https:\/\/wpmudev.com\/blog\/remove-wordpress-comments-url\/","title":{"rendered":"How To Remove The URL Field From WordPress Comments"},"content":{"rendered":"<figure id=\"attachment_112245\" class=\"wp-caption alignright\" data-caption=\"true\"><a rel=\"lightbox[112241]\" class=\"blog-thumbnail\" href=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/03\/cut.jpg\" target=\"_blank\"><img loading=\"lazy\" decoding=\"async\" class=\"size-ratio-2-3 wp-image-112245\" title=\"cut\" src=\"https:\/\/wpmudev.com\/blog\/wp-content\/uploads\/2013\/03\/cut-312x206.jpg\" alt=\"Post image\" aria-hidden=\"true\" width=\"312\" height=\"206\" \/><\/a><figcaption class=\"wp-caption-text\">Cut the URL field out of the WordPress comment form<\/figcaption><\/figure>\n<p>There are some WordPress sites where you may not want to include the URL field in the comment form. It&#8217;s not always necessary and spammers tend to use it to link to their spammy websites, which will be posted in your comments if you have auto-approval turned on. Just to be safe, you may want to remove that URL field altogether.<\/p>\n<p>Here&#8217;s a quick snippet I found the other day while browsing <a href=\"http:\/\/wpsnipp.com\/index.php\/comment\/remove-unset-url-field-from-comment-form\/\" rel=\"noopener\" target=\"_blank\">WPSNIPP.com<\/a>. You can add the code below to your theme&#8217;s <em>functions.php<\/em> file or create a quick functionality plugin for it &#8211; your choice.<\/p>\n<pre class=\"brush: php; title: ; notranslate\" title=\"\">\r\n\r\nadd_filter('comment_form_default_fields', 'unset_url_field');\r\nfunction unset_url_field($fields){\r\nif(isset($fields&#x5B;'url']))\r\nunset($fields&#x5B;'url']);\r\nreturn $fields;\r\n}\r\n\r\n<\/pre>\n<p>Pretty simple, right? Use this same formula for removing any of the other comment fields from the form. This is assuming that you&#8217;re using the default <a href=\"https:\/\/wpmudev.com\/blog\/customizing-wordpress-comment-form\/\" target=\"_blank\" rel=\"noopener\">WordPress comment form<\/a>. If you&#8217;re using a plugin, there may be an even easier way to remove that field within the form building settings.<\/p>\n<p>photo credit: <a href=\"http:\/\/www.flickr.com\/photos\/photobunny_earl\/3055409176\/\" target=\"_blank\">photobunny<\/a> via <a href=\"http:\/\/photopin.com\" target=\"_blank\">photopin<\/a> <a href=\"http:\/\/creativecommons.org\/licenses\/by-nc-nd\/2.0\/\" target=\"_blank\">cc<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Prevent users from entering their website URLs by removing the field from the default WordPress comment form.<\/p>\n","protected":false},"author":4099,"featured_media":112245,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"blog_reading_time":"","wds_primary_category":0,"wds_primary_tutorials_categories":0,"footnotes":""},"categories":[263],"tags":[264],"tutorials_categories":[],"class_list":["post-112241","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-tutorials","tag-comments"],"_links":{"self":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112241","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/users\/4099"}],"replies":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/comments?post=112241"}],"version-history":[{"count":2,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112241\/revisions"}],"predecessor-version":[{"id":184887,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/posts\/112241\/revisions\/184887"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media\/112245"}],"wp:attachment":[{"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/media?parent=112241"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/categories?post=112241"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tags?post=112241"},{"taxonomy":"tutorials_categories","embeddable":true,"href":"https:\/\/wpmudev.com\/blog\/wp-json\/wp\/v2\/tutorials_categories?post=112241"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}