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.
Related reading
Add custom content to WordPress comment form
How to check if user is logged-in in WordPress
WordPress: send an email on new comments
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.
Related reading
Add custom content to WordPress comment form
How to check if user is logged-in in WordPress
WordPress: send an email on new comments
Recent Articles
Related Articles
If you enjoyed reading this, then please explore our other articles below:
Why WordPress 7.0 Centralized AI Keys Through the Connectors API
WordPress 7.0 Armstrong: Native AI Client, Abilities API, and What Got Cut
Cloudflare EmDash: A TypeScript CMS That Aims to Replace WordPress Plugin Architecture
WordPress Site Hacked? A Full Recovery Playbook From Containment to Hardening
Git From Scratch: Concepts, Commands, and the Workflow That Actually Sticks
MTA-STS in Enforce Mode: How a Single Misconfigured Policy Blocks Every Gmail Message
WordPress 7.0 RC1 Drops Real-Time Collaboration, AI Connectors, and a Redesigned Dashboard
bfcache, Speculation Rules and AI Debugging – Three Browser Features That Kill Page Load Delays
More Articles
If you enjoyed reading this, then please explore our other articles below:
Git Checkpointing When Building Apps With Copilot, Codex and Other AI Agents
September 22nd, 2026|
Build a FastAPI Backend With AI: REST API, Authentication and a Persistent Database
September 15th, 2026|
Build a Full-Stack App With GitHub Copilot: FastAPI, React and Next.js From Scratch
September 11th, 2026|
Docker for AI-Built Apps: Containers Explained, First Project and Production
September 10th, 2026|
How to Review and Test AI-Generated Code Before You Deploy It
September 4th, 2026|
Debugging AI-Generated Code: How to Get Unstuck When the Agent Keeps Failing
September 3rd, 2026|
Free AI Models on OpenRouter: API Keys, Model Choice and Building a Next.js AI App
August 27th, 2026|
Vibe Coding in Practice: Principles, Real Productivity Gains and Limits
August 22nd, 2026|
Best LLMs for Agentic Coding: How to Choose, Compare and Switch Models
August 19th, 2026|