Eliminación por lotes de publicaciones y imágenes destacadas en WordPress

Intermedio

Este es unMarketingflujo de automatización del dominio deautomatización que contiene 14 nodos.Utiliza principalmente nodos como If, Filter, HttpRequest, ManualTrigger. Eliminación masiva de publicaciones y imágenes destacadas de WordPress

Requisitos previos
  • Pueden requerirse credenciales de autenticación para la API de destino

Categoría

Vista previa del flujo de trabajo
Visualización de las conexiones entre nodos, con soporte para zoom y panorámica
Exportar flujo de trabajo
Copie la siguiente configuración JSON en n8n para importar y usar este flujo de trabajo
{
  "meta": {
    "instanceId": "90f9a6ef38ec632934192a5de51518245cd649d4287258dedc9971969910cdb7"
  },
  "nodes": [
    {
      "id": "268a318e-a605-40dc-b28f-b16ff038399d",
      "name": "eliminar 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": "obtener 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": "obtener 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": "eliminar 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": "Filtrar",
      "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": "Tiene 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": "Nota adhesiva",
      "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": "Nota adhesiva2",
      "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": "Nota adhesiva4",
      "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": "Nota adhesiva3",
      "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": "Nota adhesiva5",
      "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": "eliminar post con 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": "Nota adhesiva1",
      "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": "Cambia tu Dominio aquí",
      "type": "n8n-nodes-base.manualTrigger",
      "position": [
        300,
        580
      ],
      "parameters": {},
      "typeVersion": 1
    }
  ],
  "pinData": {
    "Change your Domain here": [
      {
        "wpUrl": "https://setyourwordpresshere.com"
      }
    ]
  },
  "connections": {
    "0d00aa0f-c030-489d-a7e1-744cdf0c1c7b": {
      "main": [
        [
          {
            "node": "1f6f520f-35f1-4424-9cec-431175c42c0f",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "1f6f520f-35f1-4424-9cec-431175c42c0f": {
      "main": [
        [
          {
            "node": "97381d8a-bcba-4ea6-9fce-ab56a1588c83",
            "type": "main",
            "index": 0
          }
        ],
        [
          {
            "node": "c18c430f-98d9-4e7c-9688-3cc2cfa5daa3",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "97381d8a-bcba-4ea6-9fce-ab56a1588c83": {
      "main": [
        [
          {
            "node": "268a318e-a605-40dc-b28f-b16ff038399d",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "07eb4f65-da06-413b-af1e-98504dc6050c": {
      "main": [
        [
          {
            "node": "0d00aa0f-c030-489d-a7e1-744cdf0c1c7b",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "268a318e-a605-40dc-b28f-b16ff038399d": {
      "main": [
        [
          {
            "node": "72d4044c-8e62-43dc-8fd7-0b3fc9accbca",
            "type": "main",
            "index": 0
          }
        ]
      ]
    },
    "ac2c0f9a-ed6a-44cc-8ac7-0498187133e4": {
      "main": [
        [
          {
            "node": "07eb4f65-da06-413b-af1e-98504dc6050c",
            "type": "main",
            "index": 0
          }
        ]
      ]
    }
  }
}
Preguntas frecuentes

¿Cómo usar este flujo de trabajo?

Copie el código de configuración JSON de arriba, cree un nuevo flujo de trabajo en su instancia de n8n y seleccione "Importar desde JSON", pegue la configuración y luego modifique la configuración de credenciales según sea necesario.

¿En qué escenarios es adecuado este flujo de trabajo?

Intermedio - Marketing

¿Es de pago?

Este flujo de trabajo es completamente gratuito, puede importarlo y usarlo directamente. Sin embargo, tenga en cuenta que los servicios de terceros utilizados en el flujo de trabajo (como la API de OpenAI) pueden requerir un pago por su cuenta.

Información del flujo de trabajo
Nivel de dificultad
Intermedio
Número de nodos14
Categoría1
Tipos de nodos5
Descripción de la dificultad

Adecuado para usuarios con experiencia intermedia, flujos de trabajo de complejidad media con 6-15 nodos

Enlaces externos
Ver en n8n.io

Compartir este flujo de trabajo

Categorías

Categorías: 34