Skip to content


How to Make Disqus Notify the Post Author When a New Comment Is Posted?

By default, in a multi-authors blog, you can get WordPress to notify the post author when a new comment is posted. To do this, you just have to update the “Email me whenever” field in “Settings -> Discussion”.

comment-email-me

Now if you are using Disqus as your comment system, you will find that it won’t notify the author when a new comment is posted. Instead, it will only notify the moderators.

To fix this, go to the Disqus-Comment-System folder in the Plugins directory. Open the disqus.php in a text editor. Scroll down to line 289 where you see the following:

$comment_id = $commentdata['comment_ID'];
update_comment_meta($comment_id, 'dsq_parent_post_id', $comment->parent_post);
update_comment_meta($comment_id, 'dsq_post_id', $comment->id);

Add in the line “wp_notify_postauthor($comment_id);” so that it becomes:

$comment_id = $commentdata['comment_ID'];
update_comment_meta($comment_id, 'dsq_parent_post_id', $comment->parent_post);
update_comment_meta($comment_id, 'dsq_post_id', $comment->id);
wp_notify_postauthor($comment_id);

Save, upload and replace the file back to the server.

That’s it. It should notify your authors whenever there is a new comment.

Posted in Hacks.

Tagged with , .

  • http://www.techerator.com/ Evan W.

    Wow, this is fantastic. This has been my biggest frustration since switching to Disqus – my authors no longer have any idea when anybody comments on their posts. This will fuel replies + author esteem.

  • http://www.quizzer.com.ar/ Quizzer

    thanks for the info :D

  • http://www.tipsblogger.com/ Shafar

    Awesome Damien! I was looking for this and I thought to drop a feedback at disqus help center. But this hack is working fine. I think disqus developers should see this post!

    Thanks again. :D

  • http://tryhandmade.com/ Erika Jurney

    Do you know how to make it send a notification to both the admin *and* the author? I like to see all the comments, but I also want the authors to see the ones from their posts.

    Thanks for this great tip!
    Erika

  • fotografimy

    great!!!! i am just about to write to disqus, you're the man! this is very crucial for multiauthors blog!

  • http://friendlywebconsulting.com Michelle

    I've tried this on my multiauthor blog but it doesn't work. I'm not aware that checking the "Email me whenever" boxes will send notifications to post authors – for me that has only ever sent the emails to "me" – the blog administrator. Is there another plugin I should be using, or a function to put in my functions.php file?

  • Michelle

    Posting another comment because I forgot to subscribe on the previous comment and meant to :-)

  • http://wpdailybits.com Damien Oh

    Checking the "Email me whenever anyone posts a comment" will send an email notification to the author when a comment is posted. However if you are using Disqus, it will replace the conventional comment system, thus bypassing the email to authors feature.

  • http://gonzague.me Gonzague Dambricourt

    You can probably receive emails from Disqus as the admin while post authors will receive them by WordPress

  • http://gonzague.me Gonzague Dambricourt

    awesome thanks a lot ! I dont understand why this isnt integrated in Disqus … would make things easier.

    But I suppose this uses WordPress traditional comments mails so we kinda loose one of Disqus cool features : the ability to reply by email to a comment :)

  • http://maketecheasier.com/ Damien Oh

    Yes, you are correct. By inserting the above code, the admin will receive mails from Disqus, while the authors will receive mails from wordpress.

  • http://maketecheasier.com/ Damien Oh

    Yes, you are right. But to start with, Disqus doesn’t even send a mail to the authors, so this is already a bonus.

  • http://gonzague.me Gonzague Dambricourt

    exactly, I find your fix very useful , its just very sad that Disqus doesnt do anything to help in that regard :/

    I asked them on Twitter but they dont seem to reply to everybody ..

  • http://chocoladesign.com Filipe Fernandes

     FUCK YEAH! o/
    Thanks so much for sharing, was very helpful!

    o/

  • http://chocoladesign.com Filipe Fernandes

     hey dude! not seem to work very well. I have just received e-mail alerts on new comments. the other authors are not getting. I did exactly as the post says, but really dont work. what is happening? I need to configure anything on my Disqus dashboard?

    thanks!

  • http://www.xicom.biz/ web development services

    Thanks for the information..

  • http://shapeuplife.com/ Sameer Khan

    doesn’t seem to be working…can sm1 help me with it ??

  • http://maketecheasier.com/ Damien Oh

    Open the disqus.php file and search for the line

    update_comment_meta($comment_id, ‘dsq_post_id’, $comment->id);

    Insert the line

    wp_notify_postauthor($comment_id);

    below it. Save and reupload the file. It should work.

  • http://shapeuplife.com/ Sameer Khan

    it only sends mail…when a comment gets approved…

  • Anonymous

    This is helpful, thanks for posting Damien. It’s too bad that DISQUS doesn’t have more hooks to work with, Ideally it would be great to have this in my functions.php file, or even better as an option in the admin.

  • http://maketecheasier.com/ Damien Oh

    Sad to say, one year after this post, Disqus still haven’t fixed the problems.

  • http://thetylerhayes.com Tyler Hayes

    Thanks for writing this @4706cc8b40c3544c75b82104d4af1f38:disqus . Sorry no one on our team saw this (way) earlier.

    After taking a look at the proposed code change (which is a pretty neat hack) this actually isn’t something we’re able to include as a feature in our plugin.

    To elaborate a bit: in Disqus each thread of comments has only one author just like each post in WordPress has only one author. By default each thread in a Disqus forum has the same author: the primary moderator of that forum (i.e., the person who registered the forum on Disqus). Authors in Disqus can only be changed using our Author-specific moderation add-on.

    The code change provided here doesn’t actually change the author of the thread in Disqus nor does it send a Disqus notification; it sends WordPress notifications to the author of the post in WordPress. Sending a Disqus, rather than WordPress, notification would require changing the thread’s author in our system.

    That said, I’ve added this to our internal list of features and, should we perform any fundamental refactoring on our author infrastructure, we’ll re-visit adding this feature. Don’t hesitate to reach out to us at http://disqus.com/support and http://twitter.com/disqus any time with any further questions, thoughts, or sweet hacks. And thanks again for putting this doc together!

  • http://maketecheasier.com/ Damien Oh

    Hi Tyler,

    Thanks for coming over to comment and answer the question.

    I didn’t look into the full structure of the disqus plugin, so I am not sure how it works. However, as an editor for a multi-author blog, I must say that the author comment notification is very important to me (and many other multi-authors blog) and this hack is very necessary. I do appreciate if you can look into the issue and see if you can provide a workaround for this.

  • http://www.homelivingstyle.com/Modern_Vanities_s/1088.htm modern bath vanities

    Hey, Really nice Post having a Unique title and a content too looking forward for more post like these.
    Thanks for sharing.

  • http://londonmassage.info/ London Massage

    Grate work. But am new in this and my question is are disqus backlinks dofollow. 

    For exp if i comment here and there stay my site link will that link be dofollow? or not ..
    Does google see this?

  • http://maketecheasier.com/ Damien Oh

    The links in disqus are nofollow by default.

  • http://techmansworld.blogspot.com/ MHazell

    Quick question:
    How come your a mod of every site you visit? Curious…

  • http://www.gopoolandspa.com/ pool parts

    I have no doubt to read this well feedback.this is fantastic. This has been my biggest frustration since switching to Disqus  my authors no longer have any idea when anybody comments on their posts.

  • http://www.meadcollege.qld.edu.au/diploma/business/ diploma of business

    Thanks to your and Disqus’ stance on pseudonyms, I’ve had the opportunity to communicate with creative minds from around the globe and across social hierarchies.Keep this sweet writing continue with more updates.Well done.

  • http://www.blackberryempire.com Michael

    didnt work.

  • http://electrojams.com/ Jordan

    Works perfectly! Thanks so much!

  • Umeshawasthi

    Thanks for the good hack point. I am also struggling with one issue bt unable to find any solution, we have multiple author blog with some of the author not registered with us.So we add a custom field to there post (email) and based on this email we able to recognize the author.
    Unfortunately this will not work in Disqus since we want to highlight the comment of the post author but i have not seen a way how Disqus find information about post’s author or can we tweak it so that we can tell Disqus who is the post author.
    e.g
    If the email id of the post’s custom field matches with the email id of the commentator we can flag/tell Disqus that this person is actually is the post’s author.
    We are using wordpress