How to remove Email and Website fields from Comment Form in WordPress

Looking to remove Email and Website/URL fields in your WordPress site’s comment form?

Add the following in your child theme’s functions.php:

add_filter( 'comment_form_default_fields', 'comment_form_custom_fields' );
/**
 * Remove Email and Website fields in comment form.
 *
 * @param  array $args Default comment form arguments
 * @return array       Modified comment form arguments
 */
function comment_form_custom_fields( $args ) {
    unset( $args['email'] );

    unset( $args['url'] );

    return $args;
}
This site uses cookies to offer you a better browsing experience. By browsing this website, you agree to our use of cookies.