How to remove the URL field from the WordPress comment form

how-to-remove-url-remove-word -press-wordpress

How to remove the URL field from the WordPress comment form - WordPress website attracts a lot of spammers because most of them know how easy it is to create backlinks from there. Most web creators don't know how to control spam, nor do they have time to moderate each comment.

This is often a way to comment on what a website spam looks like.

how-to-remove-url-remove-word -press-wordpress

Note that spammers do not use their real names as well as always leave a link back to the website, in most cases likely not related to the website you manage.

The perfect way to prevent spam is to completely remove the Website or URL field from your WordPress website.

how-to-delete-url-remove-word -press-wordpress

Let's think about it, in most cases, the YouTube website is not useful because the genuine commentator probably doesn't own the website, it simply agrees that spammers create a link to the website they own. property. The more comments that contain backlinks, the more posts you get from your post, the more harmful it will be for SEO efforts.

There are two methods we can use to remove a website field from a comment.

  1. Use the Plugin to disable the website field from commenting

There are many plugins available in WordPress repository that remove the Website field from website comments.

The easiest way is to set up a field or remove a website's comment / URL box.

Navigate to WP-Admin -> Plugins -> Add new and search to delete the field and then install the plugin to activate.

how-to-delete-url-remove-word -press-wordpress

After successful installation, activate the plugin to remove the Website field from the comments.

how-to-remove-url-remove-word -press-wordpress

For many, this is the easy way. However, there are people who do not want to use more plugins at the WordPress website or prefer to edit WordPress files. Create a backup before making any changes to the file.

See more: Wordpress maintenance plugin

  1. Edit the WordPress file to remove the website field from the comment

This method is only recommended for those who are proficient in editing WordPress files as well as maintaining complete documents and backups with the WordPress website.

Navigate to WP Admin -> Interface -> Editor and select the.php function

how-to-delete-url-remove-word -press-wordpress

Insert the following code into the last line in.php

add_filter (‘comment_form_default_fields’, ‘website_remove’);

website_remove function ($ field)


if (isset ($ field (‘url ')))

unset ($ field (‘url’));

return fields $;


The above code creates a function called website_remove () and deletes (or unset s) the URL field.

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

If you are a constant target of comment link spamming and you have very little time to moderate comments, then the complete elimination of the website field will prevent spammers from linking.

What do you think is a better way to handle URL spam on your website: using plugins or core editing? Let us know your opinion on this issue in the comment section below.

About My name is Nguyen Manh Cuong. I was born in a poor village in Ba Vi district, HA NOI province - windy and sunny land. Currently. Mr Cuong.
Newer Posts Newer Posts Older Posts Older Posts


Post a Comment