How to Automatically Notify Registered Users On New Posts

Updated October 6, 2023
By

Traffic generation methods are so many, and we as a blogger always try to increase our traffic. Search Engines, Social Communities and blogs plays vital role in traffic generation. 20 popular ways to promote your blog can help you in popularizing your blog and help you in maximizing your blog traffic. However today i want to share a new trick or method through which you can automatically send your newly published posts to all your registered users. If your blog is multi author then this feature is going to help you in bringing additional visitors.

notify users on new post

How to Notify Registered Users on New Post?

Just copy and paste the below code in your function.php file.

function email_members($post_ID)  {
global $wpdb;
$usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;");
$users = implode(",", $usersarray);
mail($users, "New WordPress Post online!", 'A new post has been published on http://www.YOURBLOGURL.com');
return $post_ID;
}
add_action('publish_post', 'email_members');

Make sure to change the the red highlighted link to your own domain.

Thanks to WPKube

Leave your comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

Related Posts
Search Here
Explore Laptops on DHgate