Halloween DealsAmazon USHalloween week deals: useful picks before month-endAmazon US: current deals, useful picks and tech finds.Check DealsSlow PC?RecommendedPC slow today? Run a repair scan before it gets worseResolve common Windows issues and optimize system performance.Scan NowHalloween DealsAmazon USOctober picks are moving - compare before checkoutAmazon US: current deals, useful picks and tech finds.See Picks×
Skip to content
World desk11 min

How to Automate WordPress Backups: A Complete Database-and-Files Guide

Automate WordPress backups correctly by capturing the database and files together, storing copies off-server, choosing an appropriate schedule and testing restoration.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The reliable way to automate WordPress backups is to capture both the database and the site files, keep copies away from the production server, and regularly prove that a restore works. The database holds posts, pages, comments and settings; files hold themes, plugins, uploads, configuration and custom code. A database export alone cannot rebuild a working site.

What an automated WordPress backup must contain

WordPress recovery depends on two different data sets. Treat them as one backup job, even when your tool stores them separately.

As an Amazon Associate I earn from qualifying purchases.

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Component What it contains What happens if it is missing
Database Posts, pages, comments, users, settings, plugin data and other content stored in MySQL or MariaDB You lose the site’s content and configuration, even if the files remain
Site files wp-content (uploads, themes and plugins), wp-config.php, rewrite files such as .htaccess, and any custom root or application files The database may import successfully, but the site can be missing its design, media, extensions or connection settings

The WordPress database handbook recommends regular database backups and an additional backup before an upgrade. A database-only export does not include themes, plugins, uploads or wp-config.php, so schedule a file capture alongside every database capture.

Choose an automation method

Your best method depends on how much server access you have and how granular your recovery needs to be. The following options cover the common operating models.

#1 Best Overall
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 2TB to content on the go with the Seagate Portable Drive, a USB external hard drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
Method Automation and coverage Best fit Important checks
WP-CLI plus cron Script database exports, file archives, transfers, retention and alerts. You control the entire workflow. Self-managed VPS or hosting with shell access and administrators comfortable with scripts Correct paths and permissions, off-site transfer, encryption, logging, lock handling and restore testing
UpdraftPlus Separate file and database schedules. The free edition offers every 2, 4 or 8 hours, daily, weekly, fortnightly and monthly intervals. Premium adds a selected start time and incremental backups. Site owners who want a dashboard and configurable schedules without maintaining shell scripts Remote-storage destination, retention, multisite and e-commerce behavior, component-level restore and current plan terms
Jetpack VaultPress Backup Automatic backups, browsing and downloads of backup files, and one-click restoration. Backups run at least daily and can also follow publishing or theme/plugin changes. Administrators who prefer a managed service and fast point-and-click recovery Included directories, excluded data, daily backup window, connected account access and restoration scope
WordPress.com managed plans Business and Commerce plans include Jetpack VaultPress Backup with real-time backup and one-click restore options. Other plans rely on manual content and media exports. Sites hosted on WordPress.com that want the backup operation included in the hosting plan Plan eligibility, what is covered by real-time capture, export limitations and current terms

Option 1: Build a WP-CLI and cron backup

WP-CLI is intended for automation: it can run from cron, deployment hooks or another scheduler. The commands read database credentials from wp-config.php, so you do not need to place a database password in the command line.

1. Confirm prerequisites

  • Shell access to the server that hosts WordPress.
  • WP-CLI installed for the same system user that owns the site files.
  • Permission to read the WordPress directory and write to a backup staging directory outside the public web root.
  • A separate storage destination, such as an object-storage bucket or another server, with credentials limited to backup operations.
  • A notification path for failures, for example email, a monitoring service or a deployment alert channel.

2. Export the database

From the WordPress directory, either command creates a SQL export:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
wp db export /var/backups/wordpress/database.sql

The equivalent dump command can write to a file or standard output:

wp db dump /var/backups/wordpress/database.sql

Use one command consistently in your script. Check that the resulting file is non-empty and that the command exits with a success status before proceeding.

3. Archive the files that are needed for recovery

A practical archive includes wp-content, wp-config.php, rewrite files and any custom files in the document root. Adjust the list for your installation; do not silently omit a custom integration just because it is outside wp-content.

tar -czf /var/backups/wordpress/files.tgz wp-content wp-config.php .htaccess

Exclude caches, logs and temporary directories when they can be regenerated, but first confirm that a plugin is not storing unique data there. Keep the database export and file archive associated with the same timestamp.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Add integrity checks and a transfer

Generate checksums before transferring the files:

sha256sum database.sql files.tgz > SHA256SUMS

Copy the archive, SQL file and checksum manifest to storage that is not the production server. Protect the transfer credentials separately from the archive. Encrypt the archive in transit and at rest when your storage service does not already provide suitable encryption. A backup that an attacker can delete with the production server is not an independent recovery copy.

Rank #2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
  • Easily store and access 5TB of content on the go with the Seagate portable drive, a USB external hard Drive
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

5. Apply retention and prevent overlapping runs

Keep multiple points in time rather than only the newest archive. Retention is a business decision: a shop with frequent orders may need many short-interval copies, while a low-change brochure site may retain fewer daily or weekly copies. Your script should delete only objects older than the approved retention window and should never remove the only known-good copy.

Use a scheduler lock so a slow upload cannot start a second run over the first. A cron entry might look like this:

0 2 * * * /usr/local/bin/wp-backup.sh >> /var/log/wp-backup.log 2>&1

Set the time for a low-traffic period, but do not assume traffic is the only load concern. Large media libraries, database tables and remote upload speed can make a job run for hours. Log each stage, return a non-zero exit status on failure and alert when the expected backup object or checksum is missing.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

6. Schedule extra captures around risky changes

Run an on-demand backup before WordPress core, PHP, theme or plugin upgrades, migrations, bulk imports and major configuration changes. Keep that pre-change copy under a clearly labeled retention rule so it is not removed with routine daily files.

Option 2: Automate with UpdraftPlus

UpdraftPlus separates file-backup and database-backup schedules, allowing you to match capture frequency to the type of change. In its free schedule choices, each component can run every 2, 4 or 8 hours, daily, weekly, fortnightly or monthly. Premium adds a selected start time and incremental backups, which can be used for full backups on one schedule and more frequent change capture on another.

Configure the schedules

  1. Open the plugin’s settings and locate the file-backup schedule and database-backup schedule. Do not configure only one of them.
  2. Choose intervals based on how quickly the site changes. A publishing site may need a shorter database interval than file interval; a site receiving frequent uploads needs a correspondingly frequent file capture.
  3. Select an off-server storage destination and authenticate it with a dedicated account where possible.
  4. Set the number of retained backup sets separately for files and database exports. Confirm that the retention setting refers to complete sets, not merely individual files.
  5. Run a manual backup and inspect the generated set before relying on the schedule.
  6. Perform a test restore of the database and files on staging, then document the exact restore controls your team must use.

Before selecting this route for a multisite network or an e-commerce installation, verify current support for that configuration, the destination you intend to use and the granularity of component restores. Plugin interfaces and plan capabilities can change, so check the current documentation when you deploy or renew.

Option 3: Use Jetpack VaultPress Backup

Jetpack describes VaultPress Backup as an automatic service with one-click restoration, backup-file browsing and downloads. Its support documentation says backups occur at least daily, with additional captures after events such as publishing or theme and plugin changes. You can configure the daily backup time for an off-peak window.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Rank #3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
  • Easily store and access 1TB to content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop. Reformatting may be required for Mac
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.

The service backs up the WordPress database and the plugins, mu-plugins, themes and uploads directories, along with eligible files in the root and wp-content. It excludes WordPress core files, caches, logs, backup directories and some tables that are not recognized as WordPress data. Because core files are excluded, a recovery plan should include a way to install the matching WordPress core version before or during restoration if those files are damaged.

Operational checks

  • Open the backup browser and confirm that recent database and file entries exist.
  • Check the timestamp after publishing, changing a plugin and changing a theme so you know which events trigger an additional capture for your site.
  • Confirm that excluded directories do not contain irreplaceable uploads, generated assets or custom application data.
  • Test one-click restoration on a staging copy and record what it replaces, what it leaves untouched and how to undo the operation.
  • Download a complete backup periodically so you retain an independent copy if the connected account becomes unavailable.

Option 4: WordPress.com managed plans

WordPress.com documentation states that Business and Commerce plans include Jetpack VaultPress Backup with real-time backup and one-click restore options. Automated backups require one of those plans; other plans can export content and media manually rather than using the same automated service.

Managed backups are saved at least once per day and can occur multiple times in a day when many changes are made. Confirm your plan, site type and current coverage in the hosting dashboard before assuming that a particular directory, custom table or external service is included. Keep a separate export when you are preparing a migration or a high-risk change.

How often should WordPress back up?

There is no universal interval, retention period, recovery-point objective or recovery-time objective. Set the schedule from the amount of data you can afford to lose and the time your organization can tolerate a broken site.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Site pattern Planning starting point Reason to adjust it
Low-change brochure site Daily database and file capture, plus a backup before every update Increase frequency when forms, memberships or frequent edits are introduced
News or publishing site Database capture every 2–8 hours and daily files, depending on publishing volume Shorten the interval when losing a few hours of posts or comments is unacceptable
Membership or store site Hourly or event-driven capture where the platform supports it, with frequent off-site copies Orders, subscriptions and customer changes may make a daily point too old
Development or migration period On-demand snapshot immediately before each risky operation, in addition to routine backups Keep the pre-change copy until the new version has passed testing

These are planning examples, not guarantees supplied by WordPress or a backup vendor. Measure the actual backup duration and restore duration, then make sure the schedule finishes before the next run starts.

Store backups away from production

Local server snapshots are useful for speed but weak against a compromised account, disk failure or an accidental deletion command. Keep at least one copy in a separate administrative account or location, and consider a second provider or offline copy for critical sites.

  • Use a dedicated storage identity with write access to the backup location but no permission to alter the live site.
  • Enable encryption at rest and protect encryption keys independently from the server.
  • Restrict archive downloads and log every access.
  • Use immutable or versioned storage when the site is exposed to ransomware or destructive administrator errors.
  • Do not place backup archives inside a publicly reachable WordPress directory.
  • Check available storage before each run and alert before the destination is full.
Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

Verify that a backup can actually restore

A successful upload proves only that bytes were copied. A restore rehearsal proves that those bytes form a usable site.

Rank #4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
  • Easily store and access 4TB of content on the go with the Seagate Portable Drive, a USB external hard drive.Specific uses: Personal
  • Designed to work with Windows or Mac computers, this external hard drive makes backup a snap just drag and drop
  • To get set up, connect the portable hard drive to a computer for automatic recognition no software required
  • This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable
  • The available storage capacity may vary.
  1. Create an isolated staging site with a PHP and database version compatible with the backup.
  2. Put the production site in maintenance mode if you are performing a live recovery; for a rehearsal, work entirely on staging.
  3. Restore the files, including wp-content, configuration and custom root files.
  4. Create an empty database and import the SQL export with wp db import database.sql or the equivalent database client.
  5. Set correct file ownership and permissions, then verify that wp-config.php points to the restored database.
  6. If the hostname changes, use a dry-run search-and-replace process before changing stored URLs. Review serialized data carefully; a blind text replacement can corrupt it.
  7. Log in, open representative posts, test media, submit a form, check scheduled tasks and exercise the store or membership workflow if applicable.
  8. Record how long each step took and update the runbook with the exact commands, dashboard controls and credentials location.

Repeat the rehearsal after major WordPress, PHP, database or hosting changes. A restore procedure that only one administrator understands is an operational risk, so keep the runbook in a secure team location.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Troubleshoot common automation failures

The database export succeeds but the site is incomplete

This is expected when only the database was scheduled. Add a file archive containing wp-content, configuration and custom files, then test a combined restore.

Cron reports success but no new backup exists

Run the script as the same user cron uses, use absolute paths for WP-CLI and utilities, and check the working directory. Inspect the log for a failed transfer that was hidden by a pipeline or ignored exit status. Add an explicit check for the expected archive and checksum.

The backup job overlaps the next run

Measure archive and upload duration, move the schedule to a quieter window, reduce unnecessary data and add a lock. Never allow two jobs to write to the same temporary directory.

Remote storage is full

Review retention and remove only copies that are older than the approved policy. Increase capacity or shorten the interval after confirming that the resulting recovery points still meet the business requirement.

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

A plugin or theme is missing after restore

Inspect the archive contents and verify that the backup process had permission to read the relevant directory. For managed services, compare the documented inclusion and exclusion rules with your installation, especially custom directories.

The restored site redirects to the wrong domain

Check the restored database URLs, configuration constants, web-server rules and any search-and-replace operation. Test the replacement on staging first and clear page, object and CDN caches only after the URL configuration is correct.

A practical operating checklist

  • List every recoverable item: database, uploads, themes, plugins, configuration, custom code and external integration settings.
  • Select one scheduler: cron with WP-CLI, a plugin scheduler or a managed service.
  • Capture database and files as a matched set.
  • Send copies off the production server and protect storage credentials.
  • Set frequency from the site’s change rate and acceptable data loss.
  • Define retention, encryption, access controls and failure alerts.
  • Run a staging restoration and record the duration.
  • Document the order: files, database, permissions, URLs, caches and functional tests.
  • Repeat the restore rehearsal after major platform or hosting changes.

Which approach should you use?

Choose WP-CLI and cron when you need full control, custom retention and integration with existing server operations. Choose UpdraftPlus when a dashboard and separate configurable schedules are more valuable than maintaining shell code. Choose Jetpack VaultPress Backup when managed capture, event-triggered backups and one-click restoration fit your workflow, while checking its documented exclusions. Choose a WordPress.com Business or Commerce plan when you want those managed backup capabilities included with hosted WordPress and your plan qualifies.

Regardless of the tool, the non-negotiable design is the same: automate the database and files together, keep an independent copy, alert on failures and prove recovery on a schedule. Automation without a tested restore is only an assumption that your site can be recovered.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Quick Recap

Bestseller No. 1
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate 2TB Portable Hard Drive | USB 3.0 (STGX2000400) | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$129.99
Bestseller No. 2
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
Seagate Portable 5TB External Hard Drive HDD – USB 3.0 for PC, Mac, PS4, & Xbox - 1-Year Rescue Service (STGX5000400), Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$219.99
Bestseller No. 3
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
Seagate Portable 1TB External Hard Drive HDD – USB 3.0 for PC, Mac, PlayStation, & Xbox, 1-Year Rescue Service (STGX1000400) , Black
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$119.80
Bestseller No. 4
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
Seagate Portable 4TB External Hard Drive HDD – USB 3.0, 1-Year Rescue | Everyday HDD storage. Plug-and-play backup. Windows & macOS. Adobe CC trial included. 1-Year Warranty
This USB drive provides plug and play simplicity with the included 18 inch USB 3.0 cable; The available storage capacity may vary.
$189.99

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Leave a Reply

Your email address will not be published. Required fields are marked *

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
Windows Errors? Fix Them Before They SpreadFree repair scan

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.