meta import
Destructive
This command writes to your WordPress database. Always use --dry-run first.
Usage
seo-ops meta import <csv-file> [--path=<path>] [--dry-run] [--create-missing] [--update-existing=true|false]
Import SEO metadata from a CSV file (typically created by meta export).
Examples
# Dry-run to preview changes
seo-ops meta import seo-meta.csv --path=/var/www/html --dry-run
# Import with updates
seo-ops meta import seo-meta.csv --path=/var/www/html
# Create new posts for rows with post_id=NEW
seo-ops meta import seo-meta.csv --path=/var/www/html --create-missing
# Only set fields that are currently empty
seo-ops meta import seo-meta.csv --path=/var/www/html --update-existing=false
CSV Format
post_id,seo_title,seo_description,focus_keyword,canonical,noindex,og_title,og_description
123,My Title,My Description,keyword,https://example.com,0,OG Title,OG Desc
NEW,New Post Title,,keyword,,,,,
| Column | Required | Description |
|---|---|---|
post_id | Yes | WordPress post ID or NEW (with --create-missing) |
seo_title | No | SEO title |
seo_description | No | Meta description |
focus_keyword | No | Focus keyword |
canonical | No | Canonical URL |
noindex | No | 0 or 1 |
og_title | No | Open Graph title |
og_description | No | Open Graph description |
Exit Codes
| Code | Meaning |
|---|---|
| 0 | Success (all rows processed) |
| 1 | Errors during import (some rows failed) |
| 2 | Usage error (missing CSV file) |
| 4 | WordPress path not configured |