Bulk Update Posts from CSV
wp_bulk_update_postsUpdate many WordPress posts from a CSV file, setting fields like title, content, status, categories, and tags. Empty cells preserve existing values, and dry-run mode previews changes before applying.
Instructions
Update many posts from a CSV. Required column: id. Optional: title, content, status, slug, excerpt, categories (comma-separated IDs), tags (comma-separated IDs), featured_media. Empty cells are SKIPPED (no change to that field). Defaults to dry_run=true.
Args:
csv_path (string): Path to CSV file. Required.
dry_run (boolean): Default true. Set false to apply changes.
stop_on_error (boolean): Default false.
response_format (enum): markdown | json. Default 'markdown'.
Use case: backfill categories on the 45 "Uncategorized" posts.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| dry_run | No | Default true. Set false to actually write. | |
| csv_path | Yes | Path to CSV. Required columns: id. Optional columns: title, content, status, slug, excerpt, categories (comma-sep IDs), tags (comma-sep IDs), featured_media. | |
| stop_on_error | No | Default false (continue on errors). True = stop at first error. | |
| response_format | No | Output format: 'markdown' for human-readable, 'json' for machine-readable. | markdown |