WP Options Backup Restore is a WordPress plugin that provides automated daily backups for specified WordPress options and allows the restoration of options via the command-line interface (CLI).
- Scheduled Backups: Daily backups for specified WordPress options.
- Backup Retention: Configurable number of backups to retain for each option.
- CLI Support: Restore options using the WP-CLI command line.
- Download the plugin ZIP file.
- Upload and activate the plugin through the WordPress admin or using WP-CLI.
By default, the plugin backs up the siteurl
and sidebars_widgets
options. You can modify the options to be backed up by updating the OBR_OPTIONS
constant in the plugin file.
define( 'OBR_OPTIONS', ['siteurl', 'sidebars_widgets'] );
Adjust the number of backups to retain for each option by modifying the OBR_BACKUP_LENGTH
constant in the plugin file.
define( 'OBR_BACKUP_LENGTH', 3 );
List all backed-up options, including the backup count and time keys.
wp option-backup list
View a specific backup for a given option and time key.
wp option-backup view <option_name> [<time_key>] [--format=<format>]
Restore a specific backup for a given option and time key.
wp option-backup restore <option_name> [<time_key>] [--yes]
Manually trigger an immediate backup for all specified options.
wp option-backup now [--yes]
- Author: Rick Hurst
- License: GPL version 2 or later - GNU GPL 2.0