search ]

Remove Website Field from WordPress Comment Form

There are situations where the “Website” (or URL) field is not needed in the comment form. In such cases, remove the field by adding the following code to your functions.php file:

/**
 * Remove the URL field
 *
 * @param array $fields
 *
 * @return array
 */
function sv_comment_form_default_fields( $fields ) {
	if ( isset( $fields['url'] ) ) {
		unset( $fields['url'] );
	}

	return $fields;
}

add_filter( 'comment_form_default_fields', 'sv_comment_form_default_fields' );

If you use a child theme, add this code to your child theme’s functions.php file.

Join the Discussion
0 Comments  ]

Leave a Comment

To add code, use the buttons below. For instance, click the PHP button to insert PHP code within the shortcode. If you notice any typos, please let us know!

Savvy WordPress Development official logo