WPBeginner

Beginner's Guide for WordPress

  • Blog
    • Beginners Guide
    • News
    • Opinion
    • Showcase
    • Themes
    • Tutorials
    • WordPress Plugins
  • Start Here
    • How to Start a Blog
    • Create a Website
    • Start an Online Store
    • Best Website Builder
    • Email Marketing
    • WordPress Hosting
    • Business Name Ideas
  • Deals
    • Bluehost Coupon
    • SiteGround Coupon
    • WP Engine Coupon
    • HostGator Coupon
    • Domain.com Coupon
    • Constant Contact
    • View All Deals »
  • Glossary
  • Videos
  • Products
X
☰
Beginner's Guide for WordPress / Start your WordPress Blog in minutes
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
Recommended
WordPress Plugins
View all Guides

WPBeginner» Blog» Plugins» How to Add Custom Fields to Comments Form in WordPress

How to Add Custom Fields to Comments Form in WordPress

Last updated on November 17th, 2014 by Editorial Staff
54 Shares
Share
Tweet
Share
Pin
Free WordPress Video Tutorials on YouTube by WPBeginner
How to Add Custom Fields to Comments Form in WordPress

WordPress comes with a built-in comment system which allows you to have lively discussion around your content. By default, the comment area shows 4 fields (name, email, website address, and message). Recently one of our users asked us if they could add their own custom fields to WordPress comments form. The answer of course is yes. In this article, we will show you how to add custom fields to comments form in WordPress.

Video Tutorial

Subscribe to WPBeginner

If you don’t like the video or need more instructions, then continue reading.

First thing you need to do is install and activate the WordPress Comments Fields. Upon activation, the plugin will add a new menu item labeled ‘Comments Fields’ in your WordPress menu.

You need click on it to go to the plugins settings screen where you can add custom fields to the comment form.

Drag and drop input fields to the form

Currently, there are four types of custom fields you can add to your comment form (text input, select box, radio buttons, and checkboxes).

Simply drag a field and add it to the area labeled ‘Drag form fields here’. You will be able to see the options for each field as soon as you drop it in the editable area.

Configuring your custom comment form field

Each field usually has a title which will be displayed as the custom field label on your comment form. Data name is the name of the form field which needs to be all lower case and will be used to store the data.

Apart from that, you can also add a description text, an error message, and make a field required. Lastly you can also add a CSS class to each custom field, so that you can modify its appearance if needed (See our guide on how to style your WordPress comment form).

You can add as many custom fields as you want. Once you are done, simply click on the Save all changes button to store your settings.

The custom fields will appear just before the comment textarea. You can use the CSS class you added to adjust the appearance of the custom field.

Custom fields in WordPress comment form

The data entered by users in the custom fields will appear below their comments as comment meta.

Custom fields in the comment form will appear as comment meta

You will also be able to see the data entered into these fields on the comments page in your WordPress admin area.

Custom fields appearing as comment meta in the admin area

We hope this article helped you add custom fields to comments form in WordPress. You may also want to take a look at our tutorial on how to style WordPress comments layout.

If you liked this article, then please subscribe to our YouTube Channel for WordPress video tutorials. You can also find us on Twitter and Google+.

54 Shares
Share
Tweet
Share
Pin
Popular on WPBeginner Right Now!
  • Checklist

    Checklist: 15 Things You MUST DO Before Changing WordPress Themes

  • How to Fix the Error Establishing a Database Connection in WordPress

    How to Fix the Error Establishing a Database Connection in WordPress

  • Revealed: Why Building an Email List is so Important Today (6 Reasons)

    Revealed: Why Building an Email List is so Important Today (6 Reasons)

  • How to Properly Move Your Blog from WordPress.com to WordPress.org

About the Editorial Staff

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Trusted by over 1.3 million readers worldwide.

The Ultimate WordPress Toolkit

10 Comments

Leave a Reply
  1. Minimo says:
    Apr 17, 2019 at 4:15 pm

    This plugin hasn’t been update in 2 years. Is there any trustworthy aka. actively maintained solution? Cheers!

    Reply
    • WPBeginner Support says:
      Apr 18, 2019 at 11:38 am

      While we don’t have a specific plugin we would recommend at the moment, you could take a look at advanced custom fields for another possible method. We will be sure to look for other plugin options

      Reply
  2. Justin says:
    Nov 16, 2015 at 5:32 pm

    Cool plugin. Does this work with BuddyPress comments?

    Thanks,

    Justin

    Reply
  3. Peter says:
    Jul 11, 2015 at 8:29 pm

    Thanks for this great post.

    I want to add a conditional php code in the comments template source file. The idea is to check the value of a custom field chosen by a user and then to display some text depending on it ((For example, ” if (CUSTOM_Field = ‘A’) { echo ‘…”; } else { echo ‘…’; }). How can I retrieve the custom field?

    Reply
  4. Olawale Daniel says:
    May 28, 2015 at 12:17 am

    Helpful tutorial…I love this plugin. But is there a way to manually code this without installing this plugin?

    Thanks for your support.

    Reply
  5. R. F. says:
    Apr 21, 2015 at 3:37 am

    Nice tutorial! Everything works fine, but now I am looking for an option to ONLY display the extra content of the comment form on a specific page, NOT on all pages.

    Does anyboday have an idea of how this can be arranged?

    Thanks!

    Reply
    • Dmitry says:
      Jun 7, 2015 at 4:21 am

      hi,
      Maybe my solution is not universal but I had to realize the same feature on my web site.
      I just added a custom field to the whole comment form for all the pages and hide this field in my css. Then showed it for a body page class.
      E.g:
      .custom_field_name{display: none}
      body.customer-feedback .custom_field_name{display: block}
      If your field must be required, just make it NOT required in the plugin admin area and do a custom field check with javascript in your page.php theme file,
      E.g:
      <? echo(is_page('customer-feedback')) ? 'if(document.querySelector(‘.custom_field_name’).value == ”) alert(‘Please fill Custom Field’);’ : ” ?>

      Reply
  6. FlickChicks says:
    Oct 27, 2014 at 12:40 pm

    Thanks for this post! I am wondering if this plugin will allow you to change the phrase “Leave a Reply” to something else like “Share Your Thoughts.” I have looked around and not seen an easy fix/plugin for this. I’ve noticed that in wordpress.com sites you can change it under “Settings” but not in .orgs. Any info would be appreciated. I’m using a child theme and could add code easily in a function.php file, but other than that I’m still pretty new to all this. Thanks!

    Reply
    • WPBeginner Staff says:
      Oct 27, 2014 at 2:33 pm

      Here is how you can add a custom title to the comment form.

      Reply
  7. Joie says:
    Oct 23, 2014 at 12:21 pm

    I actually have a question about something other than this regarding comments. I wrote a post on my (twenty twelve theme) blog yesterday and then shared it on my facebook (personal) page. It showed up on FB with the title of the blog -a straight vertical line- then the title of my website. In the middle of the first sentence was the “Leave a reply.” It really looked messed up. I looked all over the coding so I could cut and paste it at the bottom. It wasn’t there. I suspect it is in the Editor (under Appearnces) coding. But I am afraid to mess with that. Can you please (!) help me with this?

    Reply

Leave a Reply Cancel reply

Thanks for choosing to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and your email address will NOT be published. Please Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.

Over 1,320,000+ Readers

Get fresh content from WPBeginner

Featured WordPress Plugin
TrustPulse
TrustPulse
Instantly get 15% more conversions with social proof. Learn More »
How to Start a Blog How to Start a Blog
I need help with ...
Starting a
Blog
WordPress
Performance
WordPress
Security
WordPress
SEO
WordPress
Errors
Building an
Online Store
Useful WordPress Guides
    • 7 Best WordPress Backup Plugins Compared (Pros and Cons)
    • How to Fix the Error Establishing a Database Connection in WordPress
    • Why You Need a CDN for your WordPress Blog? [Infographic]
    • 30 Legit Ways to Make Money Online Blogging with WordPress
    • Self Hosted WordPress.org vs. Free WordPress.com [Infograph]
    • Free Recording: WordPress Workshop for Beginners
    • 24 Must Have WordPress Plugins for Business Websites
    • How to Properly Move Your Blog from WordPress.com to WordPress.org
    • 5 Best Contact Form Plugins for WordPress Compared
    • Which is the Best WordPress Popup Plugin? (Comparison)
    • Best WooCommerce Hosting in 2020 (Comparison)
    • How to Fix the Internal Server Error in WordPress
    • How to Install WordPress - Complete WordPress Installation Tutorial
    • Why You Should Start Building an Email List Right Away
    • How to Properly Move WordPress to a New Domain Without Losing SEO
    • How to Choose the Best WordPress Hosting for Your Website
    • How to Choose the Best Blogging Platform (Comparison)
    • WordPress Tutorials - 200+ Step by Step WordPress Tutorials
    • 5 Best WordPress Ecommerce Plugins Compared
    • 5 Best WordPress Membership Plugins (Compared)
    • 7 Best Email Marketing Services for Small Business (2020)
    • How to Choose the Best Domain Registrar (Compared)
    • The Truth About Shared WordPress Web Hosting
    • When Do You Really Need Managed WordPress Hosting?
    • 5 Best Drag and Drop WordPress Page Builders Compared
    • How to Switch from Blogger to WordPress without Losing Google Rankings
    • How to Properly Switch From Wix to WordPress (Step by Step)
    • How to Properly Move from Weebly to WordPress (Step by Step)
    • Do You Really Need a VPS? Best WordPress VPS Hosting Compared
    • How to Properly Move from Squarespace to WordPress
    • How to Register a Domain Name (+ tip to get it for FREE)
    • HostGator Review - An Honest Look at Speed & Uptime (2020)
    • SiteGround Reviews from 4196 Users & Our Experts (2020)
    • Bluehost Review from Real Users + Performance Stats (2020)
    • How Much Does It Really Cost to Build a WordPress Website?
    • How to Create an Email Newsletter the RIGHT WAY (Step by Step)
    • Free Business Name Generator (A.I Powered)
    • How to Create a Free Business Email Address in 5 Minutes (Step by Step)
    • How to Install Google Analytics in WordPress for Beginners
    • How to Move WordPress to a New Host or Server With No Downtime
    • Why is WordPress Free? What are the Costs? What is the Catch?
    • How to Make a Website in 2020 – Step by Step Guide
Deals & Coupons (view all)
Churnly Coupon
Get 30% OFF on Churnly WordPress automated churn-busting plugin.
AccessPress Themes
AccessPress Themes Coupon
Get 15% off on AccessPress Themes collection of premium WordPress themes and plugins.
Featured In
About WPBeginner®

WPBeginner is a free WordPress resource site for Beginners. WPBeginner was founded in July 2009 by Syed Balkhi. The main goal of this site is to provide quality tips, tricks, hacks, and other WordPress resources that allows WordPress beginners to improve their site(s).
Join our team: We are Hiring!

Site Links
  • About Us
  • Contact Us
  • FTC Disclosure
  • Privacy Policy
  • Terms of Service
  • Free Blog Setup
  • Free Business Tools
Our Sites
  • OptinMonster
  • MonsterInsights
  • WPForms
  • SeedProd
  • Nameboy
  • RafflePress
  • Smash Balloon

Copyright © 2009 - 2021 WPBeginner LLC. All Rights Reserved. WPBeginner® is a registered trademark.

Managed by Awesome Motive | WordPress hosting by SiteGround | WordPress CDN by MaxCDN | WordPress Security by Sucuri.