Can I change what fields are displayed in the Comments form?

This answer can change depending on the theme or plugins you have installed, but the code can usually be found in similar places of the theme editor.

For example, if you are using the default Twenty Eleven theme in WordPress 3.2.1, you can verify the location of the comments call by checking here:

  1. Login to your admin interface.
  2. Click on the Appearance menu.
  3. Click on Editor under Appearance.
  4. Click Comments on the right side to edit the comments.php file.

This will bring up the page that WordPress uses to generate the comments display.

Some themes may have entered code that you can edit directly to change the display. Twenty Eleven uses the default WordPress function ‘comment_form()’ to display the form used for new comments.

A lot can be done to change the values at this point, and you should take a look at the full documentation of comment_form() for all of the details. To get you started though, click on Theme Funcitons on the right side to open the functions.php file and add the following at the bottom:

// This creates a filter to change the default comment fields.
add_filter('comment_form_default_fields', 'my_comment_changes'); 

function my_comment_changes ( $my_fields ) {
    $my_fields[ 'url' ] = ''; //This will make the website area display nothing.
    $my_fields[ 'custom' ] = 'test field only<br>'; // This will add a custom field.

    return $my_fields;
}

It can definitely get more complex than that if you need it to, but this will get you started.

Leave a Comment