WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Okay I know the title is pretty vague but I didn't know how to articulate it.

Basically, I want a plugin that sends email notifications to users who opted-in only if they specifically got replied to.

WordPress has its built-in functionality for comment threading/replying, so instead of bombarding the user with emails each time a new comment is posted on a post they've subscribed to, I'd like to give them the option to only be notified when they specifically get replied to.

I can develop this myself if need be, in fact, a preliminary search yielding no results seems to point at this.

My question is, what hooks would I take a look at? Looking at other notifier plugins, I see they make use of comment_post and others which I can come up with myself. More specifically, how would I go about knowing if user x got a direct reply?

I understand how the subscription system and all of that would work, my only concern is how to tell if a subscribed user received a direct reply through the built-in commenting system.

share|improve this question
up vote 3 down vote accepted

I figured it out. Each comment row in the wp_comments table has a field named comment_parent which stores the comment_ID of the parent comment. If the comment has no parent, then the default is 0.

So I guess on each comment post I would check the database for the posted comment's parent, and if it matched the comment of a subscriber, notify him or her.

Sounds like a plan.

share|improve this answer
Do have any code Jorge Israel Peña, where you did this. I want to do this same thing but need a bit of help with starting snippet or something. Thanks! – Zach Reed Mar 7 '12 at 20:05

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

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