Get the Best WordPress Backup
& Migration Plugin Today
Get Duplicator Now
Announcement Duplicator WP-CLI commands

Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups)

Looking for a smarter way to manage site backups? Explore Duplicator's new features, including customizable WP-CLI commands and permission settings!
Announcement Duplicator WP-CLI commands

Announcing Duplicator WP-CLI Commands (And How They Speed Up Backups) 

Written By: author avatar Joella Dunn
author avatar Joella Dunn
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.
     Reviewed By: reviewer avatar John Turner
reviewer avatar John Turner
John Turner is the President of Duplicator. He has over 20+ years of business and development experience and his plugins have been downloaded over 25 million times.

What if backing up your website could be as simple as running a single command?

Our latest Duplicator Pro update makes backups easier than ever before. We’ve added WP-CLI commands and new predefined constants!

Whether you’re managing one site or multiple websites, these new features allow you to better protect your digital assets.

From command-line tools to enhanced security features, this update is packed with functionality that will save you time and reduce complexity.

Ready to see what’s in Duplicator 4.5.20? Let’s dive in!

Streamline Tasks with Duplicator WP-CLI Commands

At Duplicator, we added WP-CLI commands so you can manage your backups from the command line. This gives developers and site administrators better control and efficiency.

WP-CLI is a tool for managing WordPress sites directly from the command line. Our latest update introduces specialized commands that make backups faster and more flexible.

Key Duplicator WP-CLI commands:

  • wp duplicator build: Create a complete site backup
  • wp duplicator cleanup: Remove backup files and temporary data
  • wp duplicator info: Quickly test and verify backup configurations

The new commands aren’t just simple. They’re incredibly powerful.

Want to save backups in a specific directory? Need to use a particular backup template? You can use WP-CLI instead of your WordPress dashboard.

Here are some ways to customize commands:

  • --template=<ID>: Use a predefined backup template
  • --dir=<path>: Change backup location
  • --delete: Automatically remove backup after creation
  • --phpsqldump, --phpzip, and --duparchive: Change the archive engine

Use the wp duplicator build -- help command to get an overview of how to customize Duplicator’s WP-CLI to work for you.

If you’re a developer, this new feature will save you a lot of time. You could script batch backups across multiple local sites in minutes.

For example, use this bash script to back up multiple sites simultaneously:

#!/bin/bash

# Define site path to user associations
declare -A site_configs=(
    ["/var/www/site1/public"]="user1"
    ["/var/www/site1/public"]="user2"
    ["/var/www/site1/public"]="user3"
    # Add more associations as needed
)

target_path="/path/to/backup/destination"

# Create and clean the destination folder
mkdir -p "$target_path" || { echo "Unable to create folder $target_path"; exit 1; }
cd "$target_path" || { echo "Unable to access folder $target_path"; exit 1; }

# Iterate through site path to user associations
for site_path in "${!site_configs[@]}"; do
    user="${site_configs[$site_path]}"
    
    # Check if the web folder exists
    if [ ! -d "$site_path" ]; then
        echo "Folder $site_path does not exist. Skipping..."
        continue
    fi

    # Execute backup
    cd "$site_path" || { echo "Unable to access $site_path"; continue; }
    echo "Creating backup for $site_path with user $user"
    sudo -u "$user" wp duplicator build --delete --dir="$target_path"
done

# Change ownership and create zip
cd "$target_path" || { echo "Unable to access $target_path"; exit 1; }
chown $USER:$USER *
zip ../backups.zip *

Duplicator will back up all your local sites at once, streamlining your workflow.

The best part about Duplicator’s WP-CLI is its flexibility. You can customize it to meet your unique needs without leaving the command line!

To start experimenting with Duplicator commands, be sure to install WP-CLI.

Customize Duplicator Access with New Predefined Constants

Imagine having a master key that lets you control who can do what with Duplicator. Our new predefined constants are exactly that — a powerful way to lock down or open up plugin capabilities.

For agencies and website managers, control is everything. You might want to prevent a client from accidentally overwriting their entire site or restrict access to certain backup features.

These new predefined constants give you that granular control.

Instead of manually adjusting access settings for each user, you can now hardcode specific restrictions. It’s like creating a barrier that prevents unauthorized access to critical site functions.

Key Constants to Control Access:

  • DUPLICATOR_DISABLE_CAP_IMPORT: Blocks backup imports
  • DUPLICATOR_DISABLE_CAP_EXPORT: Prevents backup downloads
  • DUPLICATOR_DISABLE_CAP_BACKUP_RESTORE: Removes restore functionality
  • DUPLICATOR_DISABLE_CAP_SCHEDULE: Disables backup scheduling
  • DUPLICATOR_DISABLE_CAP_STORAGE: Removes access to backup storage options

If you manage a web agency, you might want to prevent a client from importing backups. It’s as simple as adding one line to your wp-config.php file:

define('DUPLICATOR_DISABLE_CAP_IMPORT', true);

With these constants, you’ll create a locked-down environment where only you control sensitive backup and migration processes.

You can:

The DUPLICATOR_DISABLE_CAP_BASIC constant is your nuclear option. It removes Duplicator functionality from the dashboard entirely, while keeping the plugin technically active.

Upgrade Your Duplicator Plugin Today

Backups aren’t just about protecting data – they give you the freedom to innovate without worry.

All of these new features were designed to make your day-to-day site management tasks easier. From lightning-fast WP-CLI backups to advanced access controls, we’ve built Duplicator to adapt to your unique workflow.

These new features are available immediately! Be sure to update to the latest version of Duplicator Pro and start protecting your sites with unprecedented control and flexibility.

Are you using Duplicator Lite? Upgrade to Duplicator Pro to get WP-CLI commands, advanced permissions, and other productivity features.

Questions? Our support team is always ready to help you get the most out of Duplicator.

author avatar
Joella Dunn Content Writer
Joella is a writer with years of experience in WordPress. At Duplicator, she specializes in site maintenance — from basic backups to large-scale migrations. Her ultimate goal is to make sure your WordPress website is safe and ready for growth.

Disclosure: Our content is reader-supported. This means if you click on some of our links, then we may earn a commission. We only recommend products that we believe will add value to our readers.