2 Ways to notify WordPress comments author upon their replies without plugins

2 Ways to notify WordPress comments author upon their replies without plugins

As is known to all, the more plugins you use, the more memory is required in WordPress. The best way to implement different functions is to add the core snippets of the code directly by yourself, so you know which part is necessary and which part is not. In this tutorial I’m going to introduce 2 ways to notify WordPress comments author upon their replies without plugins. (The core codes is written by “willin kan” in few years ago, not me =_=)

Final result: When visitor A leave a comment on the WordPress site, any future replies to this comment will triggers the email mechanism which has been pretested, the WordPress site will then sends email to visitor A based on the email address as notification. The following figure shows the final result:

2 Ways to notify WordPress comments author upon their replies without plugins

Okay, let’s get started!

Method 1: Let comment author to decide whether send email to notify replies or not.

* mail() function is required on the server

Some server has disabled mail() function in order to prevent spams. You have to check is this function turning on or off, by checking this status, simply go to the back-end of your WordPress site and click on “Lost your password?” try to find password via email notification. If the WordPress is not able to send an email in this way, it means you have to go to Method 2, otherwise, you can continue to the next step:

Open up the  file, find a proper place (before the last “?>”) to insert the following code:

Save it and refresh your WordPress site, you can find a “checkbox” below the comment form, and the function has completed. Now make some comments and reply them for a test!

– Known issue #1: The checkbox will not appears on some mobile theme, so the comment notification will probably not working in this case.


Method 2: No checkbox, notify comment author when someone replies their comments by default.

This method is using SMTP() function on server, it is more likely to be effective. To do so, Open up the functions.php file, find a proper place (before the last “?>”) to insert the following code:

Review the code and config it at where the code annotation as. Go to your email and enable SMTP setting, then save it and it should be working well. If still cannot receive email, change the port and security setting (SSL) then try again.


Reference: 免插件实现WordPress评论回复邮件通知的三种方法


</catmee> 文章全部原创、谢绝转载,作者「BianLei」,如果喜欢欢迎分享链接,相关内容参见本站版权声明
本站相关:Facebook | YouTube | QQ空间
Tagged . Bookmark the permalink.

Comment Anonymously? No Problem! | 可以匿名评论了我会说?

Fill up Email address to subscribe reply and display your avatar from Gravatar (If any)