If you have enabled the build-in comments section in your WordPress site and want to modify it, you’ve come to the right place. Customizing the WordPress comments form is easy with the corresponding WordPress comments form hooks. You can add different content before or after the comments form or even after the form fields and above the Post comment button.

This visual guide for the WordPress comment form hooks will help you easily understand and find the right spot to add your custom content.

WordPress Comments – Visual Hook Guide

1. If the user is NOT logged in
The following hooks are available when the user is not logged in and is allowed to comment on the post and the comments are not closed:

comment_form_before

Leave A Comment

comment_form_top

comment_form_before_fields

comment_form_after_fields

comment_form

comment_form_after

2. If the user is logged in
If you are logged in, there are fewer hooks available since the name, email and website fields are not needed. The following hooks are not available when the user is logged in:

  • form_comment_before_fields
  • form_comment_after fields

3. User is not logged and “Users must be registered and logged in to comment” is activated
All unregistered users will see the following comment form with an additional hook: comment_form_must_log_in_after.

comment_form_before

Leave A Comment

You must be logged in to post a comment.

comment_form_must_log_in_after

comment_form_after

WordPress Comments Hooks

Here is a sum of the total seven WordPress comments hooks:

  1. comment_form_before
  2. comment_form_top
  3. comment_form_before_fields
  4. comment_form_after_fields
  5. comment_form
  6. comment_form_must_log_in_after
  7. comment_form_after

Learn more about Comments in WordPress.

Need help with WordPress or WooCommerce?

Visit our Community Forums

Ask a Question

Recent Articles

From Our Community Forums

Blog Categories

Related Articles

If you enjoyed reading this, then please explore our other articles below:

Comments

Leave a comment

Leave a Reply

Comment policy: We love comments and appreciate the time that readers spend to share ideas and give feedback. However, all comments are manually moderated and those deemed to be spam or solely promotional will be deleted.