BetterStudio

How to Customize the WordPress Comment Form

The fastest way to customize a WordPress comment form is to add a short function to your child theme's functions.php (or a snippets plugin) using WordPress's built-in comment_form filters, then style it with Additional CSS. For features like reCAPTCHA, comment subscriptions, or letting readers edit their own comments, a dedicated plugin is quicker than writing the code yourself.
How to Customize the WordPress Comment Form

Fastest Way to Customize the Comment Form

Most comment form changes, such as the button label, the section title, the field order, and the website field, are controlled by filters that WordPress's own comment_form() function already supports. You don't need to touch theme files directly.

  1. Go to Plugins > Add New Plugin and install a code snippets plugin, or open Appearance > Theme File Editor and select your child theme's functions.php.
  2. Paste the functions below into a new snippet or at the end of functions.php.
  3. Save and activate the snippet (or click Update File in the Theme File Editor).
  4. Go to Appearance > Customize > Additional CSS (on a block theme, use Appearance > Editor > Styles > Additional CSS) to set the comment form font.
  5. Click Publish and reload a post with comments in a private browser window to confirm the change.
add_filter( 'comment_form_defaults', function( $defaults ) {
    $defaults['label_submit'] = 'Post Comment';
    $defaults['title_reply']  = 'Join the Discussion';
    return $defaults;
} );

add_filter( 'comment_form_default_fields', function( $fields ) {
    unset( $fields['url'] );
    return $fields;
} );

To move the comment textarea below the name and email fields (or back above them), reorder the array returned by the comment_form_fields filter, which includes the comment box alongside author, email, and url:

add_filter( 'comment_form_fields', function( $fields ) {
    $comment = $fields['comment'];
    unset( $fields['comment'] );
    $fields['comment'] = $comment;
    return $fields;
} );

Always edit a child theme or a snippets plugin, not the parent theme. Parent theme edits get overwritten the next time the theme updates.

Add Fields, reCAPTCHA, and a Comment Subscription Option

These additions need a bit more than a filter, since they involve saving or verifying extra data.

Add a custom field by extending the fields array, then saving the value when the comment posts and showing it with get_comment_meta on display:

add_filter( 'comment_form_default_fields', function( $fields ) {
    $fields['phone'] = '

Phone

'; return $fields; } ); add_action( 'comment_post', function( $comment_id ) { if ( isset( $_POST['phone'] ) ) { update_comment_meta( $comment_id, 'phone', sanitize_text_field( $_POST['phone'] ) ); } } );

Add reCAPTCHA to block comment spam:

  1. Open https://www.google.com/recaptcha/admin/create and sign in with the Google account tied to the site.
  2. Fill in a label, pick a reCAPTCHA type, and add the domain the comment form runs on.
  3. Accept the terms and click Submit to get a site key and a secret key.
  4. Install a plugin that supports reCAPTCHA on the comment form, paste both keys into its settings, and enable it for comments.

Akismet filters spam by checking submitted comments against spam patterns in the background; reCAPTCHA is a separate, visible challenge shown before the comment is accepted, and the two can run together.

Add an email subscription checkbox under the comment box with Jetpack's Subscriptions feature, which you turn on from Jetpack's own settings screen (the exact tab name has shifted between Jetpack releases, so check its current settings pages if you don't see it under Discussion), or with a dedicated comment-subscription plugin from the WordPress.org repository.

Add a text editor (quicktags) to the comment box so visitors can bold, italicize, or quote text without typing raw HTML. WordPress ships the quicktags script used in the post editor; enqueue it on singular posts where comments are open, then call quicktags() against the comment textarea's id, which is "comment" on the default theme form:

function load_comment_quicktags() {
    if ( is_singular() && comments_open() ) {
        wp_enqueue_script( 'quicktags' );
        wp_add_inline_script( 'quicktags', "document.addEventListener('DOMContentLoaded', function() { if ( typeof quicktags === 'function' ) { quicktags( { id: 'comment' } ); } });" );
    }
}
add_action( 'wp_enqueue_scripts', 'load_comment_quicktags' );

If your theme names the comment textarea something other than "comment", inspect the field's id attribute in the browser and use that value in the quicktags() call instead.

Style the Form with CSS

Font, color, spacing, and the submit button's look are all CSS, not PHP. Go to Appearance > Customize > Additional CSS, or Appearance > Editor > Styles on a block theme, and add rules targeting the form.

Exact class and id names vary by theme, so open your browser's inspector on the comment section first and confirm what's actually there. Common selectors across many themes include #commentform, .comment-form, .comment-reply-title, and #submit:

#commentform textarea,
#commentform input[type="text"],
#commentform input[type="email"] {
    font-family: Georgia, serif;
    font-size: 16px;
}

#commentform #submit {
    background: #222;
    color: #fff;
    border-radius: 4px;
    padding: 10px 18px;
}

If a rule has no effect, the theme's own stylesheet is more specific than yours. Add a more specific selector rather than reaching for !important as the first fix, since that tends to cause fights with later theme updates.

Customize Comments for a Specific Post Type

The comment form is rendered inside the theme's comments.php template, and most themes call it the same way for every post type. To change behavior only for one post type, check the current post type inside the filter callback before applying the change:

add_filter( 'comment_form_defaults', function( $defaults ) {
    if ( is_singular( 'product' ) ) {
        $defaults['title_reply'] = 'Write a Review';
    }
    return $defaults;
} );

On a classic theme you can also copy comments.php into your child theme and add conditional logic directly in the template. On a block theme built with the site editor, the comment form comes from the Comments block and its pattern, and per-post-type differences are usually handled through separate templates assigned to that post type rather than PHP filters.

Plugins That Replace or Extend the Native Form

  • Jetpack adds an alternate comment form with social login options and ties into its Subscriptions feature, so readers can follow new comments by email without a separate plugin.
  • Disqus swaps the entire native comment form for a hosted system with a different look, letting readers sort comments by newest or oldest and flag ones they consider worth reading. It can also surface other content from the site to commenters. Disqus has historically shown ads inside the widget on its free tier, so check its current settings before publishing if you want them turned off rather than assume they're disabled by default.
  • Simple Comment Editing gives commenters a short window to fix typos in a comment they already posted, without needing moderator approval each time.
  • Lazy Load for Comments defers loading the comment thread and its scripts until a visitor scrolls near it or clicks to view comments, which keeps the initial page load lighter on posts with long comment sections.

Switching to Jetpack's or Disqus's comment system replaces comment_form() entirely, so any PHP filters from the sections above stop having an effect; styling and extra fields then need to go through that plugin's own settings or CSS hooks instead.

Plugin features, pricing, and support status change over time, so check each plugin's current WordPress.org listing or vendor page for compatibility with your WordPress version before installing.

When Your Changes Don't Show Up

Work through these before assuming the code is wrong:

  • Confirm the snippet is active (code pasted into a parent theme that later got updated, or a snippet left disabled, has no effect).
  • Check whether Jetpack Comments, Disqus, or a similar plugin is active. These replace the default form, so core comment_form filters are ignored until that plugin is switched off.
  • Clear any caching plugin or CDN cache after a CSS or PHP change; a stale cached page will keep showing the old form.
  • If a PHP edit causes a white screen, the snippet likely has a syntax error. Remove it through SFTP, the hosting file manager, or the code snippets plugin's safe mode, then fix and reapply it.
  • For a field that isn't saving, confirm the input's name attribute matches what the comment_post action reads from $_POST, and that the value is sanitized before it's stored.

Common questions

Can I remove the website field from WordPress comments without writing code?

WordPress's built-in Settings > Discussion screen only controls whether commenters must provide a name and email, not the website field specifically. Removing the website field requires either the comment_form_default_fields filter shown above or a plugin that offers that option in its settings.

Why isn't my comment_form_defaults filter changing anything?

Check whether a plugin like Jetpack Comments or Disqus is replacing the native form, since those bypass core WordPress filters entirely. Also check that the snippet is actually active and that no caching layer is serving an old version of the page.

Do I need Akismet and reCAPTCHA together?

No, they do different jobs. Akismet screens submitted comments against spam patterns in the background, while reCAPTCHA presents a challenge before the comment is accepted. Many sites run just one, though using both is possible.

Will editing comments.php break after a theme update?

Yes, if you edit the parent theme's file directly, since theme updates overwrite it. Copy comments.php into a child theme first, or make the change through functions.php hooks instead, which survive updates.

Can readers edit a comment after they've posted it?

Not by default. The Simple Comment Editing plugin adds a short time window in which a commenter can fix their own comment without moderator approval.

Sources

  1. WordPress Developer Resources: comment_form()
  2. Jetpack
  3. Disqus
  4. Google reCAPTCHA admin console

About this page

Last reviewed October 30, 2026 by the Better Studio editors. Read our editorial policy or report an error.