WordPress - Delete Post
Description
Section titled “Description”This module allows deleting posts from a WordPress site. By default it moves the post to trash, but with the force option it can delete it permanently.
Configuration
Section titled “Configuration”Credentials
Section titled “Credentials”| Field | Description | Example |
|---|---|---|
url | WordPress site base URL | https://my-site.com |
username | WordPress username | admin |
application_password | Application password generated in WordPress | xxxx xxxx xxxx xxxx |
Parameters
Section titled “Parameters”| Field | Type | Required | Description |
|---|---|---|---|
| credentials_id | credentials | Yes | WordPress credential |
| post_id | text | Yes | Post ID to delete |
| force | boolean | No | true = delete permanently. Default: false (trash) |
Output
Section titled “Output”{ "success": true, "deleted": { "id": 123, "status": "trash" }, "message": "Post 123 moved to trash"}Usage Example
Section titled “Usage Example”Move post to trash
Section titled “Move post to trash”{ "post_id": "123"}Delete permanently
Section titled “Delete permanently”{ "post_id": "123", "force": true}API Used
Section titled “API Used”- Endpoint:
DELETE /wp-json/wp/v2/posts/{id} - Documentation: WordPress REST API - Posts
- Without the force option, the post is moved to trash and can be recovered
- With force=true, the deletion is permanent and irreversible
- The post ID supports variables with
{{id}}syntax
Related Nodes
Section titled “Related Nodes”- WordpressGetPosts - Get posts to identify which to delete
- WordpressCreatePost - Create a new post
- WordpressUpdatePost - Update a post instead of deleting it