Remove Comment URL

If you want to remove the URL input textbox from your WordPress comment form, then use the below code inside your functions.php file.


/**
 * Function to unset the website field from the comments form.
 * @param Array $fields
 * @return Array 
 */
function rcu_disable_comment_url( $fields )
{
    if ( isset( $fields['url'] ) ){
        unset( $fields['url'] );
        return $fields;
    }
}

//We hook our function rcu_disable_comment_url with the filter comment_form_default_fields.
add_filter('comment_form_default_fields','rcu_disable_comment_url');
Remove Comment URL

if you are not a developer then simply install and activate the Remove Comment URL plugin.

This plugin will allow you to remove the URL field from the comment form on your site. This prevents automated bots to post spam links on your website.
It also helps your website retain the SEO Juice.

This is a lightweight and simple plugin which doesn’t require any settings.

Installation and Configuration

  1. Download and unzip the file.
  2. Upload the folder remove-comment-url using FTP program into ‘wp-content/plugins/’ folder.
  3. Activate the plugin and it will remove the URL file from your comment form.
  4. It doesn’t require any settings.

Leave a Comment