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:
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.
WordPress Comments Hooks
Here is a sum of the total seven WordPress comments hooks:
- comment_form_before
- comment_form_top
- comment_form_before_fields
- comment_form_after_fields
- comment_form
- comment_form_must_log_in_after
- comment_form_after
Learn more about Comments in WordPress.
WordPress Comments Form – Visual Hook Guide
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
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:
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
comment_form_after
WordPress Comments Hooks
Here is a sum of the total seven WordPress comments hooks:
Learn more about Comments in WordPress.
Recent Articles
Related Articles
If you enjoyed reading this, then please explore our other articles below:
Boost Your WooCommerce Store with Automated Two-Way Up-Sell Links
May 7th, 2024|eCommerce, WooCommerce|
The Role of UX Principles in Crafting a Winning WooCommerce Store
March 18th, 2024|WooCommerce, WordPress|
Add class to menu item if product category is empty
March 15th, 2024|WooCommerce, WordPress|
Exploring WooCommerce Alternatives for WordPress: A Comprehensive Comparison
February 27th, 2024|Plugins, WooCommerce, WordPress|
Maximizing Sales: The Best Free Abandoned Cart Recovery Plugins and Email Services for Your eCommerce Business
February 26th, 2024|eCommerce, Marketing, Plugins, WooCommerce, WordPress|
Maximizing Your eCommerce Potential: Integrating WooCommerce and Facebook Pixel
February 25th, 2024|eCommerce, Marketing, WooCommerce, WordPress|
What is Headless WordPress
Understanding Cron Jobs: Definitions and Examples
WordPress Security: Best Practices for Protecting Your Website in 2024
A Comprehensive Guide to WordPress Multilingual Websites
The Role of UX Principles in Crafting a Winning WooCommerce Store
Add class to menu item if product category is empty
Understanding Different VPN Protocols: A Comprehensive Overview
Safeguarding Your Website: Understanding and Mitigating the 10 Most Common Site Security Threats
More Articles
If you enjoyed reading this, then please explore our other articles below:
Energize Your Internal Communication Approach with Established Techniques
July 24th, 2024|
Boost Your WooCommerce Store with Automated Two-Way Up-Sell Links
May 7th, 2024|
What is Headless WordPress
April 17th, 2024|
Understanding Cron Jobs: Definitions and Examples
April 10th, 2024|
Best AI Tools for Coding in 2024: A Developer’s Essential Guide
April 7th, 2024|
WordPress Security: Best Practices for Protecting Your Website in 2024
April 2nd, 2024|
The Role of AI and Machine Learning in Enhancing SEO Strategies
March 31st, 2024|
A Comprehensive Guide to WordPress Multilingual Websites
March 27th, 2024|
Why Your Website Needs Terms and Conditions, Privacy Policy, and Cookie Policy
March 25th, 2024|
Boost Your WooCommerce Store with Automated Two-Way Up-Sell Links
May 7th, 2024|eCommerce, WooCommerce|
The Role of UX Principles in Crafting a Winning WooCommerce Store
March 18th, 2024|WooCommerce, WordPress|
Add class to menu item if product category is empty
March 15th, 2024|WooCommerce, WordPress|
Exploring WooCommerce Alternatives for WordPress: A Comprehensive Comparison
February 27th, 2024|Plugins, WooCommerce, WordPress|
Maximizing Sales: The Best Free Abandoned Cart Recovery Plugins and Email Services for Your eCommerce Business
February 26th, 2024|eCommerce, Marketing, Plugins, WooCommerce, WordPress|
Maximizing Your eCommerce Potential: Integrating WooCommerce and Facebook Pixel
February 25th, 2024|eCommerce, Marketing, WooCommerce, WordPress|
Boost Your WooCommerce Store with Automated Two-Way Up-Sell Links
May 7th, 2024|eCommerce, WooCommerce|
The Role of UX Principles in Crafting a Winning WooCommerce Store
March 18th, 2024|WooCommerce, WordPress|
Add class to menu item if product category is empty
March 15th, 2024|WooCommerce, WordPress|
Exploring WooCommerce Alternatives for WordPress: A Comprehensive Comparison
February 27th, 2024|Plugins, WooCommerce, WordPress|
Maximizing Sales: The Best Free Abandoned Cart Recovery Plugins and Email Services for Your eCommerce Business
February 26th, 2024|eCommerce, Marketing, Plugins, WooCommerce, WordPress|
Maximizing Your eCommerce Potential: Integrating WooCommerce and Facebook Pixel
February 25th, 2024|eCommerce, Marketing, WooCommerce, WordPress|