Appearance
Delete Row
The Delete Row node removes rows from a WP-Nexus database table, custom post type, or taxonomy. The input must include the row's ID to identify which record to delete.
Configuration
| Property | Type | Default | Description |
|---|---|---|---|
tableId | number | -- | Required. The ID of the WP-Nexus table to delete from. |
Input
Accepts a single object or an array of rows. Each row must include the appropriate ID field:
- Custom tables:
id - Custom post types:
ID - Taxonomies:
term_id
Output
Returns the input rows with a _deleted: true field added on success. On error, an _error field is added instead.
How It Works
Custom Table
Executes $wpdb->delete() with WHERE id = ?.
Custom Post Type
Calls wp_delete_post($postId, true) with force delete (bypasses trash).
Taxonomy
Calls wp_delete_term($termId, $taxonomy).
Example Use Cases
Delete button on a listing
Context --> Require Auth --> Delete Row (tableId: 3) --> OutputThe Context node provides the row data (including id) from the clicked item.
Delete with confirmation
In the UI builder, add a button with a confirm dialog. The action pipeline:
Context --> Require Auth (capability: "delete_posts") --> Delete Row --> OutputBatch delete
Connect an array of rows to delete multiple records:
Table Query (whereField: "expired", whereOp: "=", whereValue: "1") --> Delete Row --> OutputWARNING
Delete operations are permanent for custom tables and taxonomies. For custom post types, wp_delete_post with force delete bypasses the trash. Always protect delete pipelines with Require Auth and appropriate capability checks.
TIP
Consider using a soft delete pattern (setting a deleted_at timestamp via Update Row) instead of hard deletes for data you may need to recover.