Is there a way to have WordPress email me whenever a Page or Post is Published?
Leave a Reply
You must be logged in to post a comment.
Is there a way to have WordPress email me whenever a Page or Post is Published?
You must be logged in to post a comment.
There’s a few plugins that handle email notifications, but they all seem to act like a subscription service for (all) WordPress users.
To notify just you when a post or page is published:
You can either drop this in your theme’s
functions.php
, or save it as a plugin (which might be more appropriate, as it’s not exactly ‘theme’ related).sha — it answers the question by contributing the knowledge that the posted solution does not work in all instances.
After 24 hours, I can update the knowledge I contributed. The solution at this location ( Notify admin when page is edited? ) works on the server where the solution posted above does not. To quote from the thread with the solution that works better in the two contexts I tried:
The original script from the wpcodex works fine:
Sure, you will need to use appropriate Post Status Transition hook or hooks and
wp_mail()
.There is a very flexible plugin called “Post Status Notifier” available in the WordPress plugin directory.
You can define own rules, when a notification should get send. You can choose the recipient, Cc, Bcc, before and after status. And you can completely customize the body text and subject (with placeholders).
Works perfectly for me!
If you donât want to hack your themeâs fucntions file, then use a plugin such as this one. It send notifications to the admin when contributor submits a post for review, and email notification to the contributor when the post is published.
https://wordpress.org/plugins/wpsite-post-status-notifications/