Recently I was looking for a solution to remove or hide the website URL field on my comment form. By default, WordPress is shipped with a comment form with a name, email address and website fields. This has been the standard since the creation of WordPress CMS.

Personally, I don’t mind typing my URL or website address when completing WordPress comment form. It isn’t a problem for me, as I do have a website.

There are some people who don’t have websites. They are just there to read your content and if they have something to ask or comment about, they do sometimes use the comments form to leave comments. While the website field isn’t required on most forms, it’s just another field to deal with for folks who just want to write something quick.

Also, the website field has become a tool or technique for spammers to comment on blogs online just to spread their products and services on other blogs. Most times, they leave useless comments unrelated to the content and insert their website URLs to promote their blogs. This isn’t right and shouldn’t be allowed.

I wanted to remove the URL field on all my forms. I was searching and came upon this site which has a cool script to remove the form for WordPress blogs.

If you need to do the same, continue below to learn how to.

There are many ways and other techniques to use to remove the website field. For new users who can’t edit their WordPress files directly can use a plugin to do the job.

Users who want to use plugins to remove or hide the comment URL field can use this plugin. 

Another way to remove or hide the URL is to add the below code snippet to your function.php file. This file can be accessed from your WordPress admin page –> Appearance –> Editor.

When you’re there, select the function.php file and insert the below code are just after the last line in the file.

Copy and paste the code below into the file and save.

add_filter('comment_form_default_fields', 'remove_url');
function remove_url($fields)
{
if(isset($fields['url']))
unset($fields['url']);
return $fields;
}

 

When you’re done, restart your webserver for the changes to apply. If you’re using cache plugins, the changes will apply after the caches are expired and your pages refreshed.

This will also work if you edit your function.php file directly via SSH terminal and add the above code snippet to it. Restart your webserver and look at the comment form again. This time, the URL field should be gone.

The code above creates a function called remove_url with $fields as argument. Then using WordPress Hook Add_filter(), we pass the argument to WordPress default comment_form_default_fields function.

If there’s a better way to do this, please comment below and let our audience know.

Enjoy!

 

remove or hide wordpress comment url

 

Frequently Asked Questions

How do I remove the URL field from WordPress comment form?

You can remove the URL field from your WordPress comment form by using a plugin or adding a code snippet to your function.php file.

Why should I consider removing the website URL field from my WordPress comment form?

Removing the website URL field can help prevent spam comments and make the commenting process quicker for users who don't have websites.

Is it necessary to have the website URL field on a WordPress comment form?

The website URL field is not required for most WordPress comment forms and can be removed to streamline the user experience.

What are the risks of keeping the website URL field on a WordPress comment form?

Leaving the website URL field can attract spammers who may misuse it to promote irrelevant content on your blog.

Can I hide the website URL field on my WordPress comment form without coding?

Yes, you can use a plugin to easily hide or remove the website URL field from your WordPress comment form without the need for coding.

Are there alternative methods to remove the website URL field besides using a plugin?

Besides using a plugin, you can also manually add a code snippet to your function.php file to remove the website URL field from your WordPress comment form.

Will removing the website URL field affect genuine commenters on my WordPress blog?

Removing the website URL field will not affect genuine commenters as it is an optional field and most users do not use it for legitimate purposes.

How can I prevent spammers from abusing the website URL field on my WordPress blog?

By removing or hiding the website URL field, you can significantly reduce the chances of spammers using it to promote unrelated content on your WordPress blog.