Skip to main content

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,,,,,
ColumnRequiredDescription
post_idYesWordPress post ID or NEW (with --create-missing)
seo_titleNoSEO title
seo_descriptionNoMeta description
focus_keywordNoFocus keyword
canonicalNoCanonical URL
noindexNo0 or 1
og_titleNoOpen Graph title
og_descriptionNoOpen Graph description

Exit Codes

CodeMeaning
0Success (all rows processed)
1Errors during import (some rows failed)
2Usage error (missing CSV file)
4WordPress path not configured