How to get notifications when WordPress posts change status
Self-hosted WordPress does not provide a complete built-in setting for status-change alerts. For a simple site, add a small notification function using the status-transition hook and configure reliable email delivery; teams usually need a plugin for role-based recipients, templates and logs.
- 01Choose the changes to track
- 02Add the manual notification code
- 03Set up outgoing email
- 04Test every required transition
- 05Use a plugin for team workflows
What you need
- Administrator access to WordPress
- A reliable outgoing email method such as authenticated SMTP
- The email addresses or user roles that should receive alerts
- A staging site or test post if the site is busy
Choose the changes to track
Decide which post types and transitions should create an alert. Common choices are draft to pending review, pending review to published, scheduled to published, and published back to draft.
Also decide who receives the message. Sending every change to every administrator creates noise, while sending only publication alerts may miss a review that needs attention.
Add the manual notification code
For a small site, add a short function to a site-specific plugin or your child theme's functions file. WordPress provides the transition_post_status action with the new status, old status and post object. It can also run when a post is saved without changing status, so the code must compare the two status values before sending anything.
add_action('transition_post_status','site_status_notice',10,3); function site_status_notice($new,$old,$post){if($new===$old||wp_is_post_revision($post->ID)||$post->post_type!=='post')return; $to=get_option('admin_email'); $subject='Post status changed: '.$post->post_title; $message='Old status: '.$old.' New status: '.$new.' Edit: '.get_edit_post_link($post->ID); wp_mail($to,$subject,$message);}
This example watches normal posts and emails the site's administrator. Change the post-type check or recipient logic if you also need pages, WooCommerce products or selected users.
Set up outgoing email
The notification uses WordPress's wp_mail() function. A successful return from that function means WordPress handed the message to the mailer; it does not prove that the message reached the inbox. Configure authenticated SMTP or another dependable mail service, and use a sender address that your domain is allowed to send from.
The common Friday failure is that the status hook works but the hosting server silently drops or misroutes PHP mail. Send a test message before relying on the alerts, then check spam folders and your mail service's delivery logs.
Test every required transition
Create a test post and move it through the transitions you selected. Check draft to pending, pending to published, scheduled to published and published to draft where relevant.
Save a post without changing its status as well. The guard in the example should prevent a duplicate notification. Test revisions, autosaves and custom post types if your site uses them, because an overly broad function can send messages for content you did not intend to monitor.
Use a plugin for team workflows
The code route is fine when one administrator needs a basic email after a status change. It becomes awkward when different roles need different alerts, when you need custom message placeholders, or when you need a record of what was sent.
For that faster route, install and activate Post Status Notifier, then configure the statuses, recipients, message fields and notification logs in its settings. It is suited to editorial teams that need role-based alerts rather than one fixed email address.
Let Post Status Notifier do it
Role-based alerts with custom placeholders and notification logs; suited to teams tracking editorial status changes.
Sources
- developer.wordpress.org /reference/hooks/transition_post_status/?utm_source=openai
- developer.wordpress.org /reference/functions/wp_mail/?utm_source=openai
Questions
- Does WordPress send an email whenever a post status changes?
- No. Self-hosted WordPress does not provide a complete general-purpose setting for emailing users about every post-status transition. You need custom code hooked to the status transition action or a plugin that provides the recipient and message settings. WordPress's own administrator emails cover some specific events, not every editorial workflow change.
- Which hook should send a notification when a status changes?
- Use the <code>transition_post_status</code> action, which receives the new status, old status and post object. Always compare the old and new values because the action can also run when a post is updated while keeping the same status. Filter by post type if pages, products or custom content should not trigger alerts.
- Why did my WordPress status email not arrive?
- The usual cause is email delivery, not the status hook. <code>wp_mail()</code> can report that a message was accepted for processing without confirming inbox delivery. Configure authenticated SMTP, check the sender domain, review spam folders and inspect mail logs before changing the notification code.
- Can I notify different users for different post statuses?
- Yes, but the manual code needs recipient logic that maps each transition or post type to selected users or roles. That is manageable for one or two addresses, but it becomes maintenance work for an editorial team. A notification plugin is the quicker option when you need role-based recipients, editable templates and a history of sent alerts.
- Will scheduled posts trigger a notification when they publish?
- Yes, a scheduled post normally changes status when WordPress publishes it, so a status-transition notification can cover that event. Test scheduled publishing on your host because delayed WP-Cron jobs can postpone both the publication and the email. If the site has strict timing requirements, use a reliable cron setup and monitor delivery separately.