Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save deeman/805aa218ce37930ccdc374d35f8905e1 to your computer and use it in GitHub Desktop.
Save deeman/805aa218ce37930ccdc374d35f8905e1 to your computer and use it in GitHub Desktop.
//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;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment