Batch Delete Posts and Featured Images in WordPress

### Why use this You need to delete many posts on a WordPress website and also delete the featured image associated with each post. Hours of rote work cut into a fraction with this automation. ### How it works - Set your WordPress URL in the manual trigger node. - Set your WP post search parameters. - (WP API returns 10 posts by default; you could also set up pagination for scaling this automation beyond 10 posts per execution.) - Decide (and build) your filter/approval process. ### What you can expect - This automation is set up to run the 10 oldest `pending` posts, with oldest first. - If you remove the Filter node from the workflow, after each run, another 10 posts will be returned from WP. ### Notes on Filter/Approval This is arbitrary and depends on your own use case. Maybe you have an editor who needs to approve the post deletion. You might want to get approval by email, Slack message, or ticketing system. Or maybe you just want to monitor the process and spare specific posts from deletion. I used the Filter node to only grab the first `item` (`itemIndex < 1`), which in this case was the oldest `pending` post. This could also be **expanded** to two separate workflows: - One triggered when a `pending` post is created that sends an approval request. - A second triggered by the approval/rejection that either publishes or deletes the post, depending on the approval result. This would require another HTTP request, similar to the DELETE post request, that instead publishes the post.

n8n

1 workflows

Why use this

You need to delete many posts on a WordPress website and also delete the featured image associated with each post.

Hours of rote work cut into a fraction with this automation.

How it works

  • Set your WordPress URL in the manual trigger node.
  • Set your WP post search parameters.
  • (WP API returns 10 posts by default; you could also set up pagination for scaling this automation beyond 10 posts per execution.)
  • Decide (and build) your filter/approval process.

What you can expect

  • This automation is set up to run the 10 oldest pending posts, with oldest first.
  • If you remove the Filter node from the workflow, after each run, another 10 posts will be returned from WP.

Notes on Filter/Approval

This is arbitrary and depends on your own use case. Maybe you have an editor who needs to approve the post deletion. You might want to get approval by email, Slack message, or ticketing system.

Or maybe you just want to monitor the process and spare specific posts from deletion.

I used the Filter node to only grab the first item (itemIndex < 1), which in this case was the oldest pending post.

This could also be expanded to two separate workflows:

  • One triggered when a pending post is created that sends an approval request.
  • A second triggered by the approval/rejection that either publishes or deletes the post, depending on the approval result.

This would require another HTTP request, similar to the DELETE post request, that instead publishes the post.

$9.99
Last updated October 10, 2026
30-day money-back guarantee
Instant download
Lifetime updates included

New buyers can create an account from the cart to unlock a controlled $10 first-purchase credit on eligible orders of $25+.

Secure checkout powered by Stripe

Support

How to import this workflow into n8n

  1. 1Purchase or download the workflow to get the n8n workflow JSON file.
  2. 2In your n8n instance, open Workflows and choose "Import from File" (or paste the JSON with Ctrl+V on the canvas).
  3. 3Open each node marked with a credential warning and connect your own accounts and API keys.
  4. 4Run the workflow once manually to verify the data flow, then toggle it to Active.

Related Business Operations & ERPs workflows

Need this deployed? We'll set it up for you.

Our automation experts deploy this workflow in your stack, connect your accounts, and verify it works — or build a custom solution from scratch.