Share your feature requests anytime
Search icon Our Plugins

WP-CLI Automation

Overview

Duplicate Post RB includes full WP-CLI support, making it ideal for automation, bulk duplication, and integration with scripts or CI/CD pipelines.

Using WP-CLI allows you to duplicate content without accessing the WordPress admin interface, which is especially useful for large websites and automated workflows.


Basic duplication

To duplicate one or multiple posts by ID, use the following command:

wp rb-duplicate-post duplicate 1,2,6,7,8,9

 

This command duplicates all specified posts using the default duplication profile.


Using duplication profiles

You can control which elements are copied by specifying a duplication profile.

Each profile defines its own duplication configuration, including copied fields, metadata, and hierarchy behavior.

wp rb-duplicate-post duplicate "123,456" --profile=1

 

Posts with IDs 123 and 456 will be duplicated using the profile with ID 1. Listing available profiles

To list all available duplication profiles and their IDs, run:

wp rb-duplicate-post profiles

 

This command outputs all profiles that can be used with the –profile option. Common use cases


WP-CLI automation is especially useful for:

  • bulk duplication of posts and pages
  • automated content workflows
  • large-scale content restructuring
  • CI/CD and deployment pipelines
  • scripted or scheduled duplication tasks

Automation workflows

WP-CLI commands can be combined with shell scripts, cron jobs, or CI/CD pipelines.

This allows you to automate repetitive duplication tasks and keep content workflows consistent across environments.


Best practices

  • Always review profile configuration before running bulk commands
  • Test WP-CLI duplication on staging environments first
  • Use clear and descriptive profile names
  • Avoid running large duplication jobs directly on production sites

Next steps

Simplify your WordPress workflow!

Build faster, cleaner, and more reliable WordPress websites using lightweight plugins designed for real-world workflows.

Get started now