I'm writing a plugin that needs to display a custom link immediately near the comments. I have the option in the plugin admin to display before or after. I'm familiar with the comments_array, but that doesn't allow me to just add a string of html just before the comments or just after the comments but before the comment form.

-- ?? custom link before ?? --
-- ?? custom link after ?? --

2 Answers 2


do_action( 'comment_form_before' ); is called on line 1553 of /wp-includes/comment-template.php, right before the output of the comment form, that should handle that one for you. I'll update this if I can find the hook before the comments.


It seems like you might be able to modify Walker_Comment (found in the same file as above) to output the first link with __construct or something, but I can't give you precise implementation at the moment (for lack of time).

  • Yes, I was able to use the do_action to at least place the html before the form, after the comments_array.
    – Beer
    Jan 16, 2012 at 15:26

I think, this is the post, that you search; all hooks on comments form visualized: http://wpengineer.com/2205/comment-form-hooks-visualized/

alternativ all hooks:

  • comment_form_before
  • comment_form_top
  • comment_form_before_fields
  • comment_form_after_fields
  • comment_form
  • comment_form_after
  • 2
    Thanks, it's a nice way to visualize those hooks but they're all about the comment_form and I needed to place html before/after the comments_array.
    – Beer
    Jan 16, 2012 at 15:26

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.