How do i remove "Website" field from Wordpress comments

i have two websites i use Wordpress comments on one website and jetpack comments on another. Both websites shows website column, how do i remove it to save my site from giving unwanted backlinks ?

Topic comments Wordpress

Category Web


Yes, as every other answer has mentioned... definitely the preferred WordPress way would be using the comment_form_default_fields filter.

However, it's very conceivable you might have a situation where you need other solutions. For example, if you're using a default theme and don't want to modify it (because you wouldn't want to lose the changes if the theme gets an update). I've got a site very few plugins/customizations, but it does have an option for custom CSS/JS. I've used both Javascript and CSS solutions.

This CSS hides it from the page (same as mentioned in Vinu's answer )

form.comment-form .comment-form-url {
    display: none;
}

Even better... this JS removes the url field from the page (actually in the weird event there is more than one on a page, this would remove them all):

document.querySelectorAll('.comment-form-url').forEach(child => child.parentNode.removeChild(child));

There are 3 easy ways to do it :

SIMPLE AND SHORT: EDITING CSS Go to customize and then custom css/js and add the following code

.comment-form-url{
    display:none;
}

ADD CODE SNIPPET TO FUNCTIONS.PHP

Go to Appearance > Theme editor and click on functions.php

// url field disabler
function remove_url_comments($fields) {
    unset($fields['url']);
    return $fields;
}
add_filter('comment_form_default_fields','remove_url_comments');

USING PLUGINS

Go to Plugins > Add New and search for any one of the following plugin. Remove Fields or Remove Comment Website/URL box or disable-hide-comment-URL.

For a full explanation, you can read my blog here


1. Using Plugins to disable Website field from comments

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

The most easy way is to install Remove Fields or Remove Comment Website/URL Box.

https://wordpress.org/plugins/remove-fields/

2. Editing the WordPress Files to remove the Website field from comments

  • open functions.php file and add code.

add_filter('comment_form_default_fields', 'website_remove');

function website_remove($fields)
{
if(isset($fields['url']))
unset($fields['url']);
return $fields;
}

I guess you are talking about the website "field". If it is so, add this code in the functions.php file to remove the field:

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

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.