Graphicslot > Blog > WP Tutorial > How to Remove Website Field From WordPress Comments Form

How to Remove Website Field From WordPress Comments Form

Remove-Website-Field-From-WordPrss-Comments-from

We all know that WordPress is fully customizable and can be customized to a large extent. WordPress is best for large Repository of plugins and Resources. What happens if I want to disable the URL form the comment module? This prevents automated robots from posting spam links to your site. Its Helps your site and keep the SEO juice.

Remove Website Field From WordPress Comments Form

Remove-Website-Field-From-WordPrss-Comments

Option 1:

You Can Install This plugin and easily remove the website url from comment form.

Option 2:

Insert the following code in your theme functions.php file

//comment form url remove
function from_comment_website_url_remove($fields)
{
	if(isset($fields['url']))
		unset($fields['url']);
	return $fields;
}
add_filter('comment_form_default_fields', 'from_comment_website_url_remove');

The code above creates a function called from_comment_website_url_remove() and removes the URL field form your comment form.

Using the WordPress Hook add_filter(), we pass the argument to $default WordPress function comment_form_default_fields that contains fields of comment form.

Video Tutorial:

Imran Hossain

Hey, I am Imran Hossain, Professional UI/UX and Frontend Web designer. I have worked with a lot of well-known companies. In 2018 I decided to make a blog for free resource for graphic and web design. I have started Graphicslot in 2018. Right now I worked hard to give a lot of free resources for people who want freebies.

Leave a Reply

Your email address will not be published. Required fields are marked *