Stop receiving comment notifications as site admin

Comment list

This has bugged me for a long time. I am the webmaster on many of my clients’ sites, so it is my email address that is in the General Settings page as the site admin.

However, because of the way the wp_notify_moderator() function works, I am always emailed when a new comment is received on a site for which I have no editorial interest.

In the past, I have used GMail filters, or a fake email address in the site admin to overcome this, but that’s not a great solution. Turning comment notifications off altogether also isn’t an option, because the site’s editors still needed to receive them and you can only turn them on and off at a global level.

So after doing some searching and with a little tweaking of some other code I found online, I learned that in WordPress 3.7, a new filter was added to allow you to tweak who should receive comment notification emails.

By adding the following snippet to your functionality plugin, you remove the site’s admin email from the list of users that get sent the comment notification emails. With a little tweaking, you can extend that to include any other email addresses that you may want to remove.

2 thoughts on “Stop receiving comment notifications as site admin”

  1. robert says:

    this is the exact problem i’m having, except there are 5 admin level accounts on my wordpress setup. i only want to remove email notifications for one person, but still have the other 4 admins receive emails. would i replace admin_email with my own address hard coded in? thank you.

    1. That’s certainly one way to do it, yes. Or you can dynamically retrieve the email address using get_userdata to “futureproof it” should you ever change the email address on your account in future.

Leave a Reply

7ads6x98y