Skip to content

Instantly share code, notes, and snippets.

@jpmarchand
Last active January 7, 2016 15:09
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 jpmarchand/60719d8ce537cffa56eb to your computer and use it in GitHub Desktop.
Save jpmarchand/60719d8ce537cffa56eb to your computer and use it in GitHub Desktop.
Remove website URL field from WordPress comment form. Source: https://wordpress.org/support/topic/remove-url-and-email-fields-from-comments-form#post-3956088
<?php
//* Remove both website and email fields from WordPress comment form
function prefix_custom_comment_fields($fields) {
unset($fields['url']);
unset($fields['email']);
return $fields;
}
add_filter('comment_form_default_fields', 'prefix_custom_comment_fields');
<?php
//* Remove website URL field from WordPress comment form
function prefix_remove_website_field($fields) {
unset($fields['url']);
return $fields;
}
add_filter('comment_form_default_fields', 'prefix_remove_website_field');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment