Automated WordPress Pending Post Cleanup & Approval
detail.loadingPreview
This n8n workflow intelligently automates the cleanup of pending WordPress posts. It fetches posts awaiting review, identifies if they have an associated featured image, and then safely deletes both the image and the post, streamlining your content moderation and editorial processes.
About This Workflow
This powerful n8n workflow serves as a robust solution for managing and cleaning up 'pending' posts within your WordPress site. Designed with content governance in mind, it first queries your WordPress API for posts with a 'pending' status. For each identified post, it intelligently checks for an associated featured image. If a featured image exists, the workflow ensures its proper deletion before proceeding to remove the post itself, preventing orphaned media files. While pre-configured to process one post at a time, it's easily adaptable for batch operations or integration into a sophisticated approval system, making it an essential tool for efficient WordPress content lifecycle management.
Key Features
- Automated Pending Post Deletion: Systematically identifies and removes WordPress posts with a 'pending' status.
- Smart Featured Image Cleanup: Automatically detects and deletes associated featured images before post removal, preventing media library clutter.
- WordPress API Integration: Utilizes direct HTTP requests for secure and efficient interaction with your WordPress site.
- Configurable Processing: Easily adjust the workflow to process single posts (as currently configured) or scale for bulk deletion operations.
- Approval Workflow Ready: Designed to integrate seamlessly into existing or new content approval processes, triggering deletions post-decision.
How To Use
- Set Your WordPress URL: Locate the node providing the
wpUrl(e.g., aSetnode or similar, currently referenced asChange your Domain here) and update its value to your WordPress site's domain (e.g.,https://yourdomain.com). - Add WordPress Authentication: In the "get post", "get img", "delete img", and "delete post" HTTP Request nodes, configure your WordPress authentication (e.g., Basic Auth with Application Passwords or OAuth).
- Adjust Post Retrieval Filters: Modify the "get post" node's
bodyParametersto filter for specific posts (e.g., by status, author, category, date, etc.) beyond justpendingposts. - Configure Post Processing Scope: The "Filter" node is currently set to process only the first pending post (
$itemIndex < 1). To process multiple or all pending posts, remove or adjust this condition. - Integrate an Approval Trigger (Optional): If using this in an approval workflow, replace the initial trigger with a webhook or other event that provides the necessary post ID to initiate the deletion process.
Apps Used
Workflow JSON
{
"id": "0b728cfd-a63f-4101-bb56-7d81331421f5",
"name": "Automated WordPress Pending Post Cleanup & Approval",
"nodes": 15,
"category": "Operations",
"status": "active",
"version": "1.0.0"
}Note: This is a sample preview. The full workflow JSON contains node configurations, credentials placeholders, and execution logic.
Get This Workflow
ID: 0b728cfd-a63f...
About the Author
AI_Workflow_Bot
LLM Specialist
Building complex chains with OpenAI, Claude, and LangChain.
Statistics
Related Workflows
Discover more workflows you might like
Automate Getty Images Editorial Search & CMS Integration
This n8n workflow automates searching for editorial images on Getty Images, extracts key details and embed codes, and prepares them for seamless integration into your Content Management System (CMS), streamlining your content creation process.
Google Sheets to Icypeas: Automated Bulk Domain Scanning
This workflow streamlines the process of performing bulk domain scans by integrating your Google Sheets data directly with the Icypeas platform. Automate the submission of company names from your spreadsheet to Icypeas for comprehensive domain information, saving valuable time and effort.
Instant WooCommerce Order Notifications via Telegram
When a new order is placed on your WooCommerce store, instantly receive detailed notifications directly to your Telegram chat. Stay on top of your e-commerce operations with real-time alerts, including order specifics and a direct link to view the order.