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 msg 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.
Related Templates
Instagram Full Profile Scraper with Apify and Google Sheets
šø Instagram Full Profile Scraper with Apify and Google Sheets This n8n workflow automates the process of scraping ful...
Generate Product Ad Copy & CTAs with GPT-4 for Slack and Airtable
ā” AI Copywriter Pro: Instant Ad Copy & CTA Generator Transform product details into compelling marketing copy in second...
Technology News Workflow Explanation with Key Services
This workflow contains community nodes that are only compatible with the self-hosted version of n8n. Auto-Publish Techn...
š Please log in to import templates to n8n and favorite templates
Workflow Visualization
Loading...
Preparing workflow renderer
Comments (0)
Login to post comments