WP-CLI Commands PRO

Automate duplication tasks from the command line.

Requirements

  • WP-CLI installed and configured
  • Nixa Duplicate Pro activated with valid license
  • SSH or terminal access to your server

Command Groups

GroupDescription
duplicateDuplicate individual posts
bulkBulk duplicate multiple posts
presetManage duplication presets
logView and export duplication logs

Duplicate a Post

# Basic duplication
wp nixa-duplicate duplicate 123

# Duplicate and publish
wp nixa-duplicate duplicate 123 --status=publish

# Create 5 copies
wp nixa-duplicate duplicate 123 --copies=5

# Use a preset
wp nixa-duplicate duplicate 123 --preset=my-template

# Custom title suffix
wp nixa-duplicate duplicate 123 --title-suffix=" - Version 2"

# Get only the new post ID (for scripting)
wp nixa-duplicate duplicate 123 --porcelain

Bulk Duplicate

# Duplicate multiple posts
wp nixa-duplicate bulk 123,456,789

# Duplicate and publish all
wp nixa-duplicate bulk 123,456,789 --status=publish

# Use a preset
wp nixa-duplicate bulk 123,456,789 --preset=archive-template

Manage Presets

# List all presets
wp nixa-duplicate preset list

# Get preset details
wp nixa-duplicate preset get 1

# Create a preset
wp nixa-duplicate preset create --name="My Preset" --status=draft

# Delete a preset
wp nixa-duplicate preset delete 1 --yes

View Logs

# List recent logs
wp nixa-duplicate log list --limit=10

# Filter by user
wp nixa-duplicate log list --user=admin

# Export logs
wp nixa-duplicate log export --format=csv --output=logs.csv

# Clear old logs
wp nixa-duplicate log clear --before="90 days ago" --yes

Scripting Example

#!/bin/bash
# Duplicate all posts in a category

POST_IDS=$(wp post list --category_name=news --field=ID --format=csv | tr '\n' ',')
wp nixa-duplicate bulk "${POST_IDS%,}" --status=draft --preset=archive
Getting Help

Run wp help nixa-duplicate for full command documentation.