This workflow corresponds to n8n.io template #4976 — we link there as the canonical source.
The workflow JSON
Copy or download the full n8n JSON below. Paste it into a new n8n workflow, add your credentials, activate. Full import guide →
{
"nodes": [
{
"id": "268a318e-a605-40dc-b28f-b16ff038399d",
"name": "delete img",
"type": "n8n-nodes-base.httpRequest",
"position": [
1700,
420
],
"parameters": {
"url": "={{ $('Change your Domain here').item.json.wpUrl }}/wp-json/wp/v2/media/{{ $json.id }}",
"method": "DELETE",
"options": {},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "force",
"value": "true"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "97381d8a-bcba-4ea6-9fce-ab56a1588c83",
"name": "get img",
"type": "n8n-nodes-base.httpRequest",
"position": [
1520,
420
],
"parameters": {
"url": "={{ $('Change your Domain here').item.json.wpUrl }}/wp-json/wp/v2/media/{{ $('Filter').item.json.featured_media }}",
"options": {}
},
"typeVersion": 4.2
},
{
"id": "07eb4f65-da06-413b-af1e-98504dc6050c",
"name": "get post",
"type": "n8n-nodes-base.httpRequest",
"position": [
600,
580
],
"parameters": {
"url": "={{ $('Change your Domain here').item.json.wpUrl }}/wp-json/wp/v2/posts",
"options": {},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "status",
"value": "pending"
},
{
"name": "order",
"value": "asc"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "c18c430f-98d9-4e7c-9688-3cc2cfa5daa3",
"name": "delete post",
"type": "n8n-nodes-base.httpRequest",
"position": [
1880,
600
],
"parameters": {
"url": "={{ $('Change your Domain here').item.json.wpUrl }}/wp-json/wp/v2/posts/{{ $('Filter').item.json.id }}",
"method": "DELETE",
"options": {},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "force",
"value": "true"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "0d00aa0f-c030-489d-a7e1-744cdf0c1c7b",
"name": "Filter",
"type": "n8n-nodes-base.filter",
"position": [
900,
580
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "d099ced6-1ad2-4b37-a877-435b4f14537c",
"operator": {
"type": "number",
"operation": "lt"
},
"leftValue": "={{ $itemIndex }}",
"rightValue": 1
}
]
}
},
"typeVersion": 2.1
},
{
"id": "1f6f520f-35f1-4424-9cec-431175c42c0f",
"name": "Has Img",
"type": "n8n-nodes-base.if",
"position": [
1200,
580
],
"parameters": {
"options": {},
"conditions": {
"options": {
"leftValue": "",
"caseSensitive": true,
"typeValidation": "strict"
},
"combinator": "and",
"conditions": [
{
"id": "c1c1463c-be82-4ba0-9dd3-280dec6c2924",
"operator": {
"type": "number",
"operation": "notEquals"
},
"leftValue": "={{ $('Filter').item.json.featured_media }}",
"rightValue": 0
}
]
}
},
"typeVersion": 2.1
},
{
"id": "36465680-6de2-484a-94e0-e7778b0ed7ef",
"name": "Sticky Note",
"type": "n8n-nodes-base.stickyNote",
"position": [
800,
240
],
"parameters": {
"width": 297.80842911877414,
"height": 512.4904214559392,
"content": "## Approvals\nBuilt out your approval process here.\n\nEither use this workflow as a manually-driven time saver. Or split it into two workflows with your approvals in an external app like Slack or email. \"Approve\" link in the external message should fire a webhook that triggers the second half of this workflow with idintifiable post info (ie. post `id` and `featured_media`)"
},
"typeVersion": 1
},
{
"id": "3e200e7f-f14b-4897-a1b1-274256fa72a7",
"name": "Sticky Note2",
"type": "n8n-nodes-base.stickyNote",
"position": [
1100,
240
],
"parameters": {
"color": 4,
"width": 317.5478927203068,
"height": 512.4904214559392,
"content": "## Router\nThis step detects if the post has a featured image associated."
},
"typeVersion": 1
},
{
"id": "9f017854-e445-409f-a465-5eef1c09e891",
"name": "Sticky Note4",
"type": "n8n-nodes-base.stickyNote",
"position": [
1420,
240
],
"parameters": {
"color": 6,
"width": 696.8275862068976,
"height": 512.4904214559392,
"content": "## This is the Magic\nIf the post has a featured media associated, the workflow will first deleted that media, then delete the post.\n\nIf it has no media associated, then the workflow simply deletes the post."
},
"typeVersion": 1
},
{
"id": "b82386f4-f759-40ac-b89a-43815875882c",
"name": "Sticky Note3",
"type": "n8n-nodes-base.stickyNote",
"position": [
200,
240
],
"parameters": {
"color": 5,
"width": 297.80842911877414,
"height": 512.4904214559392,
"content": "## Trigger\nThis workflow is set up for bulk/batch deletion of many WordPress posts.\n\nIt has been pre-loaded with the property `wpUrl` set to 'https://setyourwordpresshere.com' - which you should change to your site's domain.\n\nYou could modify this into your post approval or editorial process, in which case you'd use a different trigger, maybe when a post in WP is saved (you can also filter based on `stats`, ie. when a post with `status` **'pending review'** is created)."
},
"typeVersion": 1
},
{
"id": "03d113e5-c1c0-4dab-ac64-c6a9388b9d91",
"name": "Sticky Note5",
"type": "n8n-nodes-base.stickyNote",
"position": [
500,
240
],
"parameters": {
"color": 3,
"width": 297.80842911877414,
"height": 512.4904214559392,
"content": "## Get Your Posts\n**IMPORTANT:** Be sure to add your authentication for WordPress in the HTTP Request node.\n\nThis request will return all `pending` status posts, ordered by *date, descending*. So it returns the oldest pending posts first. You can adjust these parameters, as well as add other filters like `categories`, etc."
},
"typeVersion": 1
},
{
"id": "72d4044c-8e62-43dc-8fd7-0b3fc9accbca",
"name": "delete post with img",
"type": "n8n-nodes-base.httpRequest",
"position": [
1880,
420
],
"parameters": {
"url": "={{ $('Change your Domain here').item.json.wpUrl }}/wp-json/wp/v2/posts/{{ $('Filter').item.json.id }}",
"method": "DELETE",
"options": {},
"sendBody": true,
"bodyParameters": {
"parameters": [
{
"name": "force",
"value": "true"
}
]
}
},
"typeVersion": 4.2
},
{
"id": "3ccd76b6-8b6f-462e-bb29-a539b7a8e286",
"name": "Sticky Note1",
"type": "n8n-nodes-base.stickyNote",
"position": [
2120,
240
],
"parameters": {
"color": 7,
"width": 286.52873563218395,
"height": 512.490421455939,
"content": "## Expansion\nYou might consider storing the results of the deleted posts to a data storage tool like Airtable, Nocodb, Sheets, or a database, for good record keeping."
},
"typeVersion": 1
},
{
"id": "ac2c0f9a-ed6a-44cc-8ac7-0498187133e4",
"name": "Change your Domain here",
"type": "n8n-nodes-base.manualTrigger",
"position": [
300,
580
],
"parameters": {},
"typeVersion": 1
}
],
"connections": {
"Filter": {
"main": [
[
{
"node": "Has Img",
"type": "main",
"index": 0
}
]
]
},
"Has Img": {
"main": [
[
{
"node": "get img",
"type": "main",
"index": 0
}
],
[
{
"node": "delete post",
"type": "main",
"index": 0
}
]
]
},
"get img": {
"main": [
[
{
"node": "delete img",
"type": "main",
"index": 0
}
]
]
},
"get post": {
"main": [
[
{
"node": "Filter",
"type": "main",
"index": 0
}
]
]
},
"delete img": {
"main": [
[
{
"node": "delete post with img",
"type": "main",
"index": 0
}
]
]
},
"Change your Domain here": {
"main": [
[
{
"node": "get post",
"type": "main",
"index": 0
}
]
]
}
}
}
For the full experience including quality scoring and batch install features for each workflow upgrade to Pro
About this workflow
You need to delete (many) posts on a WordPress website and also delete the featured image associated with each post.
Source: https://n8n.io/workflows/4976/ — original creator credit. Request a take-down →
Related workflows
Workflows that share integrations, category, or trigger type with this one. All free to copy and import.
Creating high-quality, SEO-friendly blog posts consistently can be time-consuming. This template helps content creators, bloggers, SEO specialists, and agencies fully automate their blogging workflow.
AI-Generated Summary Block for WordPress Posts - with OpenAI, WordPress, Google Sheets & Slack. Uses httpRequest, googleSheets, slack, wordpress. Event-driven trigger; 32 nodes.
This workflow is for content teams, marketers, and solo site owners who draft posts in Google Sheets and want a reliable way to publish to WordPress automatically — including featured images and tags.
wordpress_fb. Uses googleSheets, httpRequest. Event-driven trigger; 28 nodes.
This workflow uses KlickTipp community nodes, available for self-hosted n8n instances only.