WordPress.org

Support

Support » How-To and Troubleshooting » How to stop getting email notificaiton of comment if you made the comment?

How to stop getting email notificaiton of comment if you made the comment?

  • Okay, the topic title is a little off.

    Basically, what I want to do is this.

    I have my blog setup to email whenever a comment is made to one of my posts. It works great, and I get the emails no problem.
    However, if I make a comment to my blog, I get an email telling me that I made a comment.

    Is there a way to have it so when I make a comment myself, it won’t email me. But I want to receive the emails for comments from other people.

    I tried to search here, but didnt’ find what I was looking for.

    thanks in advance.

Viewing 15 replies - 1 through 15 (of 48 total)
  • There’s no way to suppress the notification of emails you send, by default. This could be facilitated by means of a plugin. If you’re interested in such a thing, let me know and I’ll see what I can do!

    Thats what I was thinking.
    A plugin would be great. Heck, If I knew more about php and the way wordpress works, I’d do one myself.

    It isn’t a big hassle, just something of an annoyance. Hehe. I know that I made a post, I don’t need an email on it..

    If you come up with something, I’d definetly be interested and be a guiniea pig to test it out.

    Thanks again for the reply.

    Add a second tester if you need one…. I rather don’t appreciate reminders of my own posts either.

    It could be as simple as this (untested):
    <?php
    add_action('comment_post', 'not_to_self', 1);

    function not_to_self($ID = 0) {
    global $cache_settings;

    $comment = get_commentdata($ID);
    if (get_settings('admin_email') == $comment['comment_author_email']) {
    $cache_settings('comments_notify') = 0;
    }
    return $ID;
    }
    ?>

    Testing – I’ll post back.

    [*laughs at self*] Can’t test it if I don’t know where to put it, can I?

    Sorry: save that as a file named “not-to-self.php” in /wp-content/plugins/

    Then activate the plugin.

    Heh – I almost did that, then thought it couldn’t be THAT easy! I’ll try it now….

    Hmm. It doesn’t show in the Plugins list, even after clearing cache and hard refreshing.

    Ah. I think it has to have some header info, plugin name etc. Let me tweak it a bit….

    I had to edit it and give it some plugin info like other plugins. I got it to show up and activated it, but it doesn’t like this line

    $cache_settings(‘comments_notify’) = 0;

    It responded with an error

    Parse error: parse error, unexpected ‘=’

    Gave it a plugin name, properly commented the section. Get this error after activation:

    Parse error: parse error, unexpected ‘=’ in /home/karyl/public_html/pov/wp-content/plugins/not-to-self.php on line 13

    Ack. Yes, $cache_settings isn’t a function, so the parentheses are wrong. Replace that line with this, please:
    $foo= get_settings('comments_notify'); // to make sure it gets cached
    $cache_settings->comments_notify = 0; // change the cached setting to disable notification for this comment

    Got the changes in.. No errros.. but email from me comes through..

    Thanks again for helping out. It really is appreceiated. Hopefully we can figure out the method to get it working through this testing.

    Yup. Still got a mail from a test comment. Now, I wonder if this has anything to do with the fact that my profile email and the admin email are the same?

    Are you posting as the blog administrator, or the post author? Is the email you use when posting the comment the same as the email defined for the blog administrator?

    Whoever I am when I post, I’m always logged in through the admin name/password (I phrase it that way because it depends which blog I’m in “who” I am – sorry if that makes no sense, I use my various blogs for writing etc. as well as for just “ditzoid” posts) – I tried using a level 9 persona, but then had to login/logout and mutz around when I needed to go from posting to tweaking something. It’s just not worth the aggravation….

    Yes, the email I use when posting matches the blog admin email. I’ll change “my” email and see what happens.

Viewing 15 replies - 1 through 15 (of 48 total)
  • The topic ‘How to stop getting email notificaiton of comment if you made the comment?’ is closed to new replies.