How to Automatically Notify Registered Users On New Posts


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 Automatically Notify Registered Users On New Posts

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


0 comments… add one

Leave a Comment