WordPress Automations
Delete a WordPress Post When a Post Is Published
Sometimes publishing new content means an older post is no longer needed — a temporary announcement, a placeholder, or an outdated notice. Zapify can remove it for you with the free A post is published trigger and the free Delete a post action. Because deletion is destructive, this page shows how to target the right post and test safely. No code required.
Delete is destructive
The Delete a post action removes the post you target. Always test with a throwaway post, and be especially careful before setting this automation Live on a production site.
No post-is-created trigger
Zapify has no literal "a post is created" trigger. The trigger that fires when a post first goes live is A post is published (WP_POST_PUBLISHED). To react to other status changes instead, use A post changes status (WP_POST_STATUS_CHANGED).
What this automation does
This automation pairs one free trigger with one free action:
- Trigger: A post is published (
WP_POST_PUBLISHED) - Action: Delete a post (
WP_DELETE_POST)
Whenever a post is published, Zapify deletes the specific post you target in the action.
Build the automation
The flow is the same as every Zapify automation: Zapify → Automations → Add New → pick a trigger → add an action → map fields → set the steps Live → Save.
Step 1: Create a new automation
Go to Zapify → Automations and click Add New. Name it clearly, for example Delete temporary post when a post is published.


Step 2: Choose the trigger
Click Add Trigger, choose WordPress, then select A post is published.



Set the trigger's post type field to limit which posts start the automation. Filtering the trigger is free.
Step 3: Add the Delete a post action
Click Add Action, choose WordPress, then select Delete a post.



Step 4: Choose which post to delete
The Delete a post action has two fields:
| Field | What it does |
|---|---|
| Post ID | The numeric ID of the post to remove |
| Delete permanently | Skip the trash and delete permanently. This cannot be undone. |
Enter the Post ID of the post you want removed. Leave Delete permanently off to send the post to the trash (recoverable) while you test; turn it on only when you are certain.

Step 5: Double-check the target
Because this action is destructive, confirm the Post ID points at the post you actually mean to remove — for example a temporary announcement, not live content. If you are testing, target a throwaway post created for the purpose.
Step 6: Set the steps Live and save
Each step has its own Live / Off / Draft switch, and a new automation starts as a Draft. Set both the trigger and the Delete a post action to Live, then Save.

Step 7: Test it safely
Create a throwaway test post to use as the delete target, then publish a separate test post that matches the trigger's post type. Open Posts and confirm the target post is gone (in the trash if Delete permanently was off). Check Zapify → Logs to confirm the run.
Action result tokens
After it runs, the Delete a post action exposes Deleted post ID and Deleted post title for use in later steps.
Conclusion
With the free A post is published trigger and Delete a post action, Zapify cleans up an outdated post the moment new content goes live — just verify the target post and test before you go Live. Next, see how to update a post when a post is published, or browse the triggers and actions reference.
FAQs
Will this delete every post when a new one is published?
No. The Delete a post action removes only the single post whose ID you enter in the Post ID field. It does not touch the post that triggered the automation or any other content. Confirm the Post ID is correct before setting the automation Live, especially on a production site.
Can I recover a post Zapify deletes?
Only if Delete permanently is left off. With that field off, the post is sent to the WordPress trash and can be restored. Turn Delete permanently on and the post skips the trash and is removed for good — this cannot be undone, so use it deliberately.
Is there a "post is created" trigger?
No. Zapify has no literal "a post is created" trigger. Use A post is published (WP_POST_PUBLISHED) to start the automation when a post first goes live, or A post changes status (WP_POST_STATUS_CHANGED) for other transitions. Both are free triggers.
How do I test this without losing real content?
Create a throwaway post specifically as the delete target and enter its ID in the action, leaving Delete permanently off. Then publish a separate test post that matches the trigger. Confirm only the throwaway post moved to the trash, and check Zapify → Logs. Once you trust the setup, point it at real content.
Is this automation free?
Yes. Both the A post is published trigger and the Delete a post action are included in the free version of Zapify. You can build and run this without a PRO license. Only optional refinements such as action conditions and step delays require Zapify PRO.