Title: Extra fields in Comment Form
Last modified: August 19, 2016

---

# Extra fields in Comment Form

 *  [harryatkins](https://wordpress.org/support/users/harryatkins/)
 * (@harryatkins)
 * [15 years, 8 months ago](https://wordpress.org/support/topic/extra-fields-in-comment-form/)
 * Hi,
 * I’m trying to add 2 more fields to the default WordPress Comment form, and have
   them appear in the comments as well, The first one I’m adding is a radio button
   selection out of 10 and the second is a drop down list of choices. I can add 
   the html into the ‘Comments.php’ file but don’t know how to get what the user
   has entered to appear in the comments, I’ve only found one plugin that can help
   and this doesn’t work with the latest version of WordPress (3.0.1) If anyone 
   could help me out it would be very much appreciated.
 * Many thanks in advance
 * Harry Atkins

Viewing 3 replies - 1 through 3 (of 3 total)

 *  [tubs](https://wordpress.org/support/users/tubs/)
 * (@tubs)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/extra-fields-in-comment-form/#post-1713070)
 * Hi Harry,
 * did you find a solution to your problem? I need to add the same to my comments
   form.
 * Thanks
    Jane
 *  Moderator [t-p](https://wordpress.org/support/users/t-p/)
 * (@t-p)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/extra-fields-in-comment-form/#post-1713071)
 * review this codex article:
    [http://codex.wordpress.org/Function_Reference/comment_form](http://codex.wordpress.org/Function_Reference/comment_form)
 * Also see this Otto’s comment form tips:
 * [http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/](http://ottopress.com/2010/wordpress-3-0-theme-tip-the-comment-form/)
 *  [tubs](https://wordpress.org/support/users/tubs/)
 * (@tubs)
 * [15 years, 7 months ago](https://wordpress.org/support/topic/extra-fields-in-comment-form/#post-1713072)
 * Thanks for the links t-p. I’ve had a read through, I’m not great with code and
   I;ve managed to come up with this:
 *     ```
       <?php 
   
       add_filter('comment_form_default_fields','my_fields');
       function my_fields($fields) {
   
           // New fields
           $fields['title'] = '<label>Title:</label><input type="text" name="title" value="'.(!empty($_POST['title']) ? $_POST['title'] : '').'" />';
           $fields['tracks'] = '<label>Tracks:</label><input type="text" name="tracks" value="'.(!empty($_POST['tracks']) ? $_POST['tracks'] : '').'" />';
           $fields['format'] = '<label>Format:</label><input type="text" name="format" value="'.(!empty($_POST['format']) ? $_POST['format'] : '').'" />';
   
           return $fields;
       }
       ?>
       ```
   
 * It shows on the comments form on my website and I can fill in the fields but 
   when I submit only the name/website/comment show up and the custom fields dont.
   Is there something else I need to do?
 * Thanks
    Jane

Viewing 3 replies - 1 through 3 (of 3 total)

The topic ‘Extra fields in Comment Form’ is closed to new replies.

## Tags

 * [comment](https://wordpress.org/support/topic-tag/comment/)
 * [comments-form](https://wordpress.org/support/topic-tag/comments-form/)
 * [extra fields](https://wordpress.org/support/topic-tag/extra-fields/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 3 replies
 * 3 participants
 * Last reply from: [tubs](https://wordpress.org/support/users/tubs/)
 * Last activity: [15 years, 7 months ago](https://wordpress.org/support/topic/extra-fields-in-comment-form/#post-1713072)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
