Best 2 Know

The Ultimate Blogging Resource

  • Advertising
  • WebHosting
  • Contact Us
  • Blogger
    • Blogger Templates
    • Blogger Tutorials
  • Browser
    • Firefox
    • Google Chrome
  • Google
  • Internet
    • Facebook
    • Twitter
  • Thesis
  • Windows
  • WordPress
    • WordPress Themes
    • WordPress Plugins
  • More
    • Linux
    • Review
    • Solutions
    • Announcements

How to Automatically notify users on new post

Do you ever wish to send your registered user’s an email whenever you do a new post , well this is basically very useful if you have a big list of user registered on your WordPress blog

So now lets implement this hacks go to functions.php and add the below code

function email_members($post_ID)  {
    global $wpdb;
    $usersarray = $wpdb->get_results("SELECT user_email FROM $wpdb->users;");
    $users = implode(",", $usersarray);
    mail($users, "New Post on WordPress Den", 'A new post have been published on http://www.wpden.net');
    return $post_ID;
}

add_action('publish_post', 'email_members');

Just edit the above code at line 5 to what ever you want

Subscribe via Email

Share this:

  • Twitter
  • Facebook
  • Pocket
  • Print
  • Email

Related

June 23, 2011 Ritesh Sanap WordPress Notify users, Notify wordpress users, Tricks, wordpress, wordpress hacks

Post navigation

Previous Previous post: WordPress SEO Plugin by Yoast
Next Next post: BlackSpire WordPress Theme

Currently Trending

  • How to download Specific parts of YouTube videos
  • h4x0r ( Hacker ) - Blogger Template
  • How to Change the Welcome/Login Screen in Windows XP ?
  • Highlight Author Comment in Blogspot
  • How to Increase Dropbox upload speed
  • How To Change Windows XP Shutdown Dialog Box
  • Windows Vista CD key
  • Advanced What should we Write about next? - WordPress Plugin
  • A Great Magic Trick With Google - Fool your Friends

Random Posts

How to RIP A MOVIE

May 7, 2010 By Ritesh Sanap Leave a Comment

How To Make Your Own Run Commands : Must See

March 1, 2009 By Ritesh Sanap 1 Comment

Hack Window’s Xp Password

January 16, 2008 By Ritesh Sanap Leave a Comment

How to show hidden files and folders in Mac OS X

August 2, 2016 By Ritesh Sanap Leave a Comment

Asino/Thesis Style footer for blogger

May 3, 2011 By Ritesh Sanap 18 Comments

WordPress

HTTP2 Server Push for W3 Total Cache Minify plugin

August 17, 2016 By Ritesh Sanap 5 Comments

How to Disable Emojis in WordPress

January 6, 2016 By Ritesh Sanap Leave a Comment

JetPack Related posts and Sharing not working with NGINX

November 10, 2015 By Ritesh Sanap Leave a Comment

Simply Pure – WordPress Theme

November 2, 2014 By Ritesh Sanap 2 Comments

Advanced What should we Write about next? – WordPress Plugin

July 28, 2014 By Ritesh Sanap Leave a Comment

How to Disable Self Pingback or TrackBack

January 16, 2014 By Ritesh Sanap Leave a Comment

BlueStrap – WordPress Theme

January 1, 2014 By Ritesh Sanap 15 Comments

How to Create Multiple Excerpts in WordPress

December 24, 2013 By Ritesh Sanap Leave a Comment

How to Disable Auto Update in WordPress

November 21, 2013 By Ritesh Sanap Leave a Comment

How to Delete Feedbacks from JetPack Contact Form

November 19, 2013 By Ritesh Sanap 9 Comments

Recent Posts

  • HTTP2 Server Push for W3 Total Cache Minify plugin
  • How to show hidden files and folders in Mac OS X
  • How to Disable Emojis in WordPress
  • Canva – Online Photo Editor
  • JetPack Related posts and Sharing not working with NGINX

Archives

Recommends

  • DigitalOcean – Cloud Hosting
  • Dropbox – Cloud Storage
  • Elegant Themes – WordPress Themes
  • LastPass – Password Manager
  • Like us on Facebook
  • Follow on Twitter
  • +1 on Google
  • Subscribe via Email
  • RSS Feed

© 2022 Best 2 Know · All Rights Reserved · We ♥ DigitalOcean

loading Cancel
Post was not sent - check your email addresses!
Email check failed, please try again
Sorry, your blog cannot share posts by email.