Losing a WordPress site is one of those disasters that feels distant and unlikely — right up until it happens. A botched plugin update, a compromised server, a hosting provider that quietly deletes your account for a billing lapse. The question is never if you need backups, but whether the backup strategy you have in place will actually save you when the worst-case scenario arrives.
This wordpress backup strategy guide walks through every layer of a production-grade backup system: what to back up, how often, which tools to use, where to store it, and — critically — how to verify that your backups actually work. We will cover manual methods using WP-CLI, automated solutions like UpdraftPlus and BlogVault, remote storage configuration, restore testing workflows, and the scheduling decisions that separate a real backup strategy from a false sense of security.
Understanding What Needs to Be Backed Up
Before selecting tools or schedules, you need to understand the three distinct components that make up a WordPress installation. Missing any one of them means an incomplete restore and, potentially, a broken site.
The Database
The MySQL (or MariaDB) database contains everything that makes your site unique: posts, pages, comments, user accounts, plugin settings, widget configurations, theme customizer values, and WooCommerce orders. It is the single most critical component. A site can survive losing its files if you have a clean WordPress install to drop the database back into. But a site cannot survive losing its database — that content is gone unless you have another copy.
The database is also the component that changes most frequently. Every published post, every comment, every settings tweak writes to the database. This makes it the highest-priority target for frequent backups.
The wp-content Directory
This directory holds your themes, plugins, uploads (media library), and any custom files generated by plugins (such as cache files, compiled CSS, or log files). The wp-content/uploads folder is particularly important because it contains every image, PDF, and media file you have ever uploaded. Unlike plugins and themes, which can be re-downloaded from their source, your uploads are unique to your site.
The key subdirectories to focus on:
- uploads/ — Your media library. Irreplaceable. Back up always.
- themes/ — Custom or modified themes. Child themes with custom code are critical.
- plugins/ — Can often be re-installed, but custom plugins or modified ones need backup.
- mu-plugins/ — Must-use plugins are often overlooked and frequently contain critical custom code.
WordPress Core Files and Configuration
The WordPress core files in the root directory (wp-admin/, wp-includes/, and root PHP files) can be re-downloaded from wordpress.org. However, two files in the root are unique to your installation:
- wp-config.php — Contains database credentials, authentication keys, table prefix, debug settings, and any custom constants. Losing this file means you need to know your database connection details to rebuild it.
- .htaccess (Apache) or nginx.conf snippets — Custom rewrite rules, security headers, and redirect configurations.
Full-Site vs. Partial Backups
The table below clarifies when each backup type makes sense:
| Backup Type | What It Includes | When to Use | Typical Size |
|---|---|---|---|
| Database Only | All MySQL tables | Daily or hourly for content-heavy sites | 10 MB – 500 MB |
| Files Only | wp-content, wp-config.php.htaccess | Weekly or after theme/plugin changes | 500 MB – 10+ GB |
| Full Site | Database + all files + core | Before major updates, monthly at minimum | 1 GB – 20+ GB |
| Incremental | Only changed files since last backup | Daily for large sites to save storage | Varies (usually small) |
Manual Backups with WP-CLI
WP-CLI is the command-line interface for WordPress, and it provides the fastest, most reliable way to create manual backups. If you have SSH access to your server, WP-CLI should be your first tool. It is deterministic, scriptable, and does not depend on PHP execution time limits the way browser-based plugins do.
Exporting the Database
The wp db export command creates a SQL dump of your entire database:
# Basic database export
wp db export backup-$(date +%Y%m%d-%H%M%S).sql
# Export with gzip compression (recommended for large databases)
wp db export - | gzip > backup-$(date +%Y%m%d-%H%M%S).sql.gz
# Export specific tables only (useful for partial backups)
wp db export --tables=wp_posts,wp_postmeta,wp_options partial-backup.sql
# Export and exclude transient data (reduces file size)
wp db export --tables=$(wp db tables --all-tables --format=csv) --exclude_tables=wp_options full-no-transients.sql
The $(date +%Y%m%d-%H%M%S) portion appends a timestamp to the filename, preventing overwrites and making it easy to identify when each backup was created.
Backing Up Files
Combine WP-CLI with standard Unix tools for file backups:
# Back up the entire wp-content directory
tar -czf wp-content-$(date +%Y%m%d).tar.gz wp-content/
# Back up only uploads (media library)
tar -czf uploads-$(date +%Y%m%d).tar.gz wp-content/uploads/
# Back up wp-config.php and .htaccess
cp wp-config.php wp-config.php.backup-$(date +%Y%m%d)
cp .htaccess .htaccess.backup-$(date +%Y%m%d)
A Complete WP-CLI Backup Script
Here is a production-ready shell script that creates a full backup, compresses it, and uploads it to a remote server via rsync:
#!/bin/bash
# WordPress Full Backup Script
# Usage: ./wp-backup.sh /path/to/wordpress
set -euo pipefail
WP_PATH="${1:?Usage: $0 /path/to/wordpress}"
BACKUP_DIR="/backups/wordpress"
TIMESTAMP=$(date +%Y%m%d-%H%M%S)
SITE_NAME=$(wp option get blogname --path="$WP_PATH" | tr ' ' '-' | tr '[:upper:]' '[:lower:]')
BACKUP_NAME="${SITE_NAME}-${TIMESTAMP}"
mkdir -p "${BACKUP_DIR}/${BACKUP_NAME}"
echo "[1/4] Exporting database..."
wp db export "${BACKUP_DIR}/${BACKUP_NAME}/database.sql" --path="$WP_PATH"
echo "[2/4] Backing up wp-content..."
tar -czf "${BACKUP_DIR}/${BACKUP_NAME}/wp-content.tar.gz" -C "$WP_PATH" wp-content/
echo "[3/4] Copying configuration files..."
cp "${WP_PATH}/wp-config.php" "${BACKUP_DIR}/${BACKUP_NAME}/"
[ -f "${WP_PATH}/.htaccess" ] && cp "${WP_PATH}/.htaccess" "${BACKUP_DIR}/${BACKUP_NAME}/"
echo "[4/4] Creating final archive..."
tar -czf "${BACKUP_DIR}/${BACKUP_NAME}.tar.gz" -C "$BACKUP_DIR" "$BACKUP_NAME"
rm -rf "${BACKUP_DIR}/${BACKUP_NAME}"
echo "Backup complete: ${BACKUP_DIR}/${BACKUP_NAME}.tar.gz"
echo "Size: $(du -sh "${BACKUP_DIR}/${BACKUP_NAME}.tar.gz" | cut -f1)"
# Optional: upload to remote storage
# rsync -avz "${BACKUP_DIR}/${BACKUP_NAME}.tar.gz" user@remote:/backups/
# aws s3 cp "${BACKUP_DIR}/${BACKUP_NAME}.tar.gz" s3://your-bucket/wordpress-backups/
Automating WP-CLI Backups with Cron
Schedule the script to run daily using a cron job:
# Edit crontab
crontab -e
# Run daily at 3 AM server time
0 3 * * * /usr/local/bin/wp-backup.sh /var/www/html/wordpress >> /var/log/wp-backup.log 2>&1
# Run database-only backup every 6 hours
0 */6 * * * wp db export /backups/db-$(date +\%Y\%m\%d-\%H\%M\%S).sql --path=/var/www/html/wordpress
For a deeper look at cron-based WordPress automation and debugging scheduled tasks, see our guide on WordPress Cron Jobs Explained.
UpdraftPlus: The Most Popular WordPress Backup Plugin
UpdraftPlus is the most widely installed backup plugin in the WordPress ecosystem, with over 3 million active installations. Its popularity is deserved: it handles both backups and restores from within the WordPress admin, supports a wide range of remote storage destinations, and offers a free tier that covers the core functionality most sites need.
Setting Up UpdraftPlus
After installing and activating UpdraftPlus from the WordPress plugin directory, navigate to Settings > UpdraftPlus Backups. The setup involves three decisions:
- Backup schedule — Configure separate schedules for files and the database. The database should be backed up more frequently than files.
- Remote storage — Select one or more destinations (Google Drive, Amazon S3, Dropbox, etc.).
- Retention policy — How many backup sets to keep before the oldest is deleted.
Recommended UpdraftPlus Configuration
| Setting | Recommended Value | Why |
|---|---|---|
| Files backup schedule | Weekly | Files change less frequently than database content |
| Database backup schedule | Daily | Posts, comments, orders change constantly |
| Retain file backups | 4 | One month of weekly file backups |
| Retain database backups | 14 | Two weeks of daily database backups |
| Remote storage | Google Drive or Amazon S3 | Off-server, reliable, automated authentication |
| Include in files backup | Plugins, Themes, Uploads, mu-plugins, wp-content (others) | Everything in wp-content that matters |
| Email report | Enabled | Notification if a backup fails |
UpdraftPlus Strengths and Limitations
Strengths:
- Free version is genuinely functional for single-site backups.
- Restore process is handled entirely within the WordPress admin.
- Supports splitting large backups into multiple archives to work around hosting upload limits.
- Extensive remote storage options (15+ destinations in the premium version).
Limitations:
- Relies on PHP execution. On shared hosting with strict time limits, large sites may time out during backup creation.
- No real-time or incremental backups in the free version.
- Multisite support requires the premium version.
- The restore process requires a working WordPress installation. If WordPress itself is broken, you need manual database and file restoration.
BlogVault: Server-Level Backup Intelligence
BlogVault takes a fundamentally different approach to WordPress backups. Instead of running the backup process on your web server (consuming your server’s CPU, memory, and disk I/O), BlogVault performs incremental backups on its own infrastructure. It syncs only the changes since the last backup, which means lower server load and faster backup times — especially for large sites.
How BlogVault Works
After installing the BlogVault plugin and connecting your site to their dashboard, the initial backup copies your full site to BlogVault’s servers. Every subsequent backup is incremental: only files that have changed and new database rows are transferred. This is a significant advantage for sites with large media libraries or WooCommerce stores with thousands of orders.
BlogVault Key Features
- Real-time backups — Database changes are synced as they happen, not on a schedule. For WooCommerce sites processing orders, this means you never lose a transaction.
- Off-server processing — Backup compression and storage happen on BlogVault’s infrastructure, not yours.
- One-click staging — Create a staging copy of your site from any backup point for testing.
- Automated restore testing — BlogVault can verify that a backup is restorable without you lifting a finger.
- Migration built in — Move your site to a new host directly from a backup.
BlogVault vs. UpdraftPlus: When to Choose Which
| Factor | UpdraftPlus (Free) | UpdraftPlus (Premium) | BlogVault |
|---|---|---|---|
| Price | Free | $70/year (2 sites) | $89/year (1 site) |
| Backup method | On-server, full | On-server, incremental | Off-server, incremental |
| Real-time DB sync | No | No | Yes |
| Server load | High during backup | Moderate | Minimal |
| Remote storage | User-configured | User-configured + UpdraftVault | BlogVault cloud (included) |
| Restore without WP | No | No | Yes (via dashboard) |
| Staging from backup | No | Yes (UpdraftClone) | Yes (built-in) |
| Best for | Personal blogs, small sites | Business sites, agencies | WooCommerce, high-traffic, enterprise |
For small personal blogs and projects, the free UpdraftPlus tier is more than adequate. For WooCommerce stores, membership sites, or any site where losing even an hour of data has business consequences, BlogVault’s real-time incremental approach justifies the cost.
Remote Storage Options: Where to Keep Your Backups
A backup stored on the same server as your site is not a backup. If the server’s disk fails, gets compromised, or the hosting account is terminated, both your site and your backups are gone. Remote storage is non-negotiable.
Comparing Remote Storage Destinations
| Storage Provider | Free Tier | Paid Pricing | Pros | Cons |
|---|---|---|---|---|
| Amazon S3 | 5 GB (12 months) | ~$0.023/GB/month | Industry standard, lifecycle policies, versioning | Complex IAM setup |
| Google Drive | 15 GB | $1.99/month (100 GB) | Easy OAuth setup, familiar interface | API rate limits on large backups |
| Dropbox | 2 GB | $9.99/month (2 TB) | Simple, desktop sync | Small free tier, overkill paid tier |
| Backblaze B2 | 10 GB | $0.005/GB/month | Cheapest per-GB, S3-compatible API | Less ecosystem integration |
| DigitalOcean Spaces | None | $5/month (250 GB) | S3-compatible, CDN included | No free tier |
| SFTP/SSH Remote Server | Depends on setup | Varies | Full control, no vendor lock-in | You manage the infrastructure |
Setting Up Amazon S3 for WordPress Backups
Amazon S3 remains the gold standard for backup storage. Here is how to configure it properly:
Step 1: Create an S3 bucket
- Use a descriptive name:
yoursite-wordpress-backups - Enable versioning (allows recovering previous versions of backup files)
- Enable server-side encryption (AES-256 or AWS KMS)
Step 2: Create an IAM user with minimal permissions
{
"Version": "2012-10-17",
"Statement": [
{
"Effect": "Allow",
"Action": [
"s3:PutObject",
"s3:GetObject",
"s3:DeleteObject",
"s3:ListBucket"
],
"Resource": [
"arn:aws:s3:::yoursite-wordpress-backups",
"arn:aws:s3:::yoursite-wordpress-backups/*"
]
}
]
}
This policy grants only the permissions needed for backup operations — no ability to create or delete buckets, modify IAM policies, or access other AWS services.
Step 3: Configure lifecycle rules
- Move backups older than 30 days to S3 Glacier (reduces cost by roughly 80%).
- Delete backups older than 90 days (or 365 days for compliance requirements).
- This creates a tiered storage approach: recent backups are instantly accessible, older ones are archived cheaply.
The 3-2-1 Backup Rule
The industry standard is the 3-2-1 rule:
- 3 copies of your data
- 2 different storage media/locations
- 1 copy off-site
For WordPress, a practical 3-2-1 implementation looks like:
- Copy 1: Your live site (the primary copy).
- Copy 2: Automated backup on a cloud storage provider (Amazon S3 or Google Drive).
- Copy 3: A periodic manual download stored on a local drive or a second cloud provider.
wp-config.php Backup Settings and Constants
WordPress itself has configuration constants that affect backup behavior and the environment in which backup plugins operate. Setting these properly in your wp-config.php ensures that your backup tools work reliably.
/** Increase memory limit for backup operations */
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' );
/** Increase max execution time (useful for on-server backup plugins) */
@ini_set( 'max_execution_time', 300 );
/** Enable error logging (catch backup failures) */
define( 'WP_DEBUG', false );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
/** Disable file editing from admin (security hardening) */
define( 'DISALLOW_FILE_EDIT', true );
/** Force SSL for admin area (protect backup settings) */
define( 'FORCE_SSL_ADMIN', true );
The memory limit increases are particularly important for sites with large databases. UpdraftPlus, in particular, benefits from higher PHP memory limits when compressing large backup archives.
Backup Schedules: How Often Is Often Enough
The right backup frequency depends on how often your site’s data changes and how much data loss you can tolerate. This concept is known as the Recovery Point Objective (RPO) — the maximum acceptable amount of data loss measured in time.
Recommended Schedules by Site Type
| Site Type | Database Backup | File Backup | Full Backup | RPO |
|---|---|---|---|---|
| Personal blog (weekly posts) | Daily | Weekly | Monthly | 24 hours |
| Business site (daily updates) | Every 6 hours | Daily | Weekly | 6 hours |
| WooCommerce store | Real-time or hourly | Daily | Weekly | 1 hour or less |
| Membership / LMS site | Every 4 hours | Daily | Weekly | 4 hours |
| High-traffic news/media | Hourly | Every 6 hours | Daily | 1 hour |
| Agency (multiple client sites) | Daily per site | Weekly per site | Monthly per site | 24 hours |
Event-Driven Backups
Beyond scheduled backups, you should always create a manual backup before:
- Updating WordPress core
- Updating or installing plugins and themes
- Making changes to wp-config.php or .htaccess
- Running database migrations or search-replace operations
- Making bulk content changes (imports, deletions, restructuring)
- Switching hosting providers or migrating the site
With WP-CLI, a pre-update backup is a single command:
# Backup database, then update WordPress core
wp db export pre-update-$(date +%Y%m%d).sql && wp core update
# Backup database, then update all plugins
wp db export pre-plugin-update-$(date +%Y%m%d).sql && wp plugin update --all
Restore Testing: The Most Overlooked Step
A backup that has never been tested is not a backup. It is a hope. And hope is not a strategy.
According to a widely cited statistic from the WordPress developer documentation on backups, a significant number of site owners discover their backups are incomplete or corrupted only when they actually need to restore. The fix is simple: test your restores regularly.
How to Test a WordPress Restore
Option 1: Local Restore with WP-CLI
Set up a local WordPress installation (using LocalWP, DDEV, or a simple LAMP/LEMP stack) and restore your backup there:
# 1. Create a fresh WordPress installation locally
wp core download --path=/tmp/restore-test
# 2. Create a wp-config.php for the local environment
wp config create \
--path=/tmp/restore-test \
--dbname=restore_test \
--dbuser=root \
--dbpass=root \
--dbhost=localhost
# 3. Create the database
wp db create --path=/tmp/restore-test
# 4. Import your backup database
wp db import /path/to/backup/database.sql --path=/tmp/restore-test
# 5. Extract wp-content from backup
tar -xzf /path/to/backup/wp-content.tar.gz -C /tmp/restore-test/
# 6. Update site URL to local address
wp option update siteurl 'http://localhost:8080' --path=/tmp/restore-test
wp option update home 'http://localhost:8080' --path=/tmp/restore-test
# 7. Verify the site loads and content is intact
wp post list --post_type=post --post_status=publish --path=/tmp/restore-test
wp user list --path=/tmp/restore-test
wp plugin list --path=/tmp/restore-test
Option 2: Staging Environment Restore
Most managed WordPress hosts (Cloudways, Kinsta, WP Engine) offer one-click staging environments. Create a staging site, restore your backup to it, and verify:
- The homepage loads correctly.
- Internal pages and posts are accessible.
- Images and media display properly.
- Plugin functionality works (forms, sliders, WooCommerce cart).
- The admin dashboard is accessible and functional.
Option 3: BlogVault’s Built-In Restore Testing
BlogVault provides automated restore verification. After each backup, it can spin up a temporary environment and confirm the backup is restorable — without any manual intervention. This is one of the strongest arguments for BlogVault in production environments where manual testing is impractical.
Restore Testing Schedule
At a minimum, test a full restore quarterly. For business-critical sites, test monthly. Document the results each time: did the restore complete? How long did it take? Were there any missing files or broken features? This documentation becomes invaluable when you need to restore under pressure.
Automated vs. Manual Backups: Finding the Right Balance
The debate between automated and manual backups is a false dichotomy. A robust backup strategy uses both. Automated backups handle the routine — daily database dumps, weekly file archives — while manual backups serve as checkpoints before high-risk operations.
The Case for Automation
Automated backups are not optional. Human memory is unreliable. The one time you forget to back up before an update is the time the update breaks everything. Automation removes human error from the equation.
Configure automated backups using:
- UpdraftPlus scheduled backups — Set it and forget it. The plugin handles scheduling, compression, and remote upload.
- BlogVault continuous sync — Real-time database monitoring with automatic incremental file syncs.
- Server-level cron + WP-CLI — For developers who prefer to own the entire pipeline.
- Hosting provider backups — Most managed hosts include daily backups, but treat these as a supplement, not your primary backup.
The Case for Manual Checkpoints
Manual backups are for moments of elevated risk. They are intentional, labeled, and easy to identify in your backup history. Consider this workflow before any major change:
# Label the backup with what you are about to do
wp db export pre-woocommerce-8.5-upgrade-$(date +%Y%m%d).sql
# Now proceed with the upgrade
wp plugin update woocommerce
# If something breaks, you know exactly which backup to restore
wp db import pre-woocommerce-8.5-upgrade-20260402.sql
This named-backup approach gives you clear rollback points. When your automated daily backup is 18 hours old but you made a bad change 5 minutes ago, a named manual backup is what saves you.
Hosting Provider Backups: Necessary but Not Sufficient
Most quality WordPress hosts include automated backups as part of their service. Here is what the major providers offer:
| Host | Backup Frequency | Retention | Restore Method | Off-site Storage |
|---|---|---|---|---|
| Cloudways | Configurable (hourly to weekly) | Up to 4 weeks | One-click from dashboard | Yes (separate data center) |
| Kinsta | Daily + optional hourly | 14-30 days | One-click + downloadable | Yes (Google Cloud) |
| WP Engine | Daily | 30-40 days | One-click from dashboard | Yes (AWS) |
| SiteGround | Daily | 30 days | One-click from Site Tools | Yes |
| Shared hosting (typical) | Weekly or manual (cPanel) | Varies | cPanel restore or manual | Usually no |
Why are hosting backups not sufficient on their own?
- You do not control them. If the hosting company has an infrastructure failure that also affects their backup storage, both are gone.
- Terms of service caveats. Many hosts explicitly state that backups are provided “as a courtesy” and they are not responsible for data loss.
- Retention limits. Most hosts keep backups for 14-30 days. If you discover a problem (malware, data corruption) after that window, the corrupted state is all that remains in their backup history.
- Account termination. If your hosting account is suspended or terminated (billing issues, ToS violations), you may lose access to both the site and the hosting provider’s backups simultaneously.
Use hosting backups as one layer of your strategy, not the whole strategy.
Security Considerations for Backups
Backups contain everything an attacker needs to compromise your site: database credentials, user passwords (hashed, but still), authentication keys, and potentially sensitive customer data. Treating backups as security-critical assets is essential.
Encryption
Encrypt backups before uploading to remote storage. If you are using the WP-CLI approach, add GPG encryption to your backup script:
# Encrypt the backup archive with GPG
gpg --symmetric --cipher-algo AES256 \
--output backup-encrypted.tar.gz.gpg \
backup.tar.gz
# To decrypt later
gpg --decrypt backup-encrypted.tar.gz.gpg > backup.tar.gz
UpdraftPlus Premium includes built-in encryption for database backups. BlogVault encrypts backups in transit and at rest by default.
Access Control
- Use dedicated IAM credentials for backup storage (as shown in the S3 example above).
- Never store backup credentials in version control.
- Rotate access keys periodically.
- Enable two-factor authentication on any cloud storage account used for backups.
Backup File Cleanup
Do not leave backup files on the web server where they can be accessed via a browser. A SQL dump in a publicly accessible directory is a catastrophic data leak.
# Block access to backup files via .htaccess (Apache)
<FilesMatch "\.(sql|gz|tar|zip|bak)$">
Order allow,deny
Deny from all
</FilesMatch>
Better yet, configure your backup process to immediately move or delete local copies after uploading to remote storage.
Database-Specific Backup Techniques
The database deserves special attention because it is both the most critical component and the most fragile during backup operations. A database backup taken while a complex write operation is in progress can result in an inconsistent (and unrestorable) dump.
Ensuring Consistent Database Exports
WP-CLI’s wp db export uses mysqldump under the hood. For InnoDB tables (the default in modern WordPress), mysqldump uses the --single-transaction flag by default, which ensures a consistent snapshot without locking tables. You can verify this and add additional safety flags:
# Export with explicit consistency flags
wp db export --single-transaction --quick --lock-tables=false backup.sql
# For MyISAM tables (older WordPress installations), lock tables during export
wp db export --lock-tables=true backup.sql
Excluding Unnecessary Data
Not all database data needs to be in every backup. Transient data, session data, and certain log tables can be excluded to reduce backup size and speed up the process:
# Export without specific tables
wp db export --exclude_tables=wp_actionscheduler_actions,wp_actionscheduler_logs,wp_wc_webhooks_delivery_url_cache backup-slim.sql
# Clean up transients before backup
wp transient delete --all
wp db export clean-backup.sql
For WooCommerce sites, the Action Scheduler tables can grow to millions of rows. Excluding them from routine backups and backing them up separately (or less frequently) can significantly reduce backup time.
Building a Complete Backup Strategy: Putting It All Together
A wordpress backup strategy guide would be incomplete without showing how all these components fit together. Here is a production-ready backup plan for a mid-size WordPress site:
Layer 1: Automated Plugin Backups
- UpdraftPlus or BlogVault handling daily database and weekly file backups.
- Remote storage configured (Amazon S3 or Google Drive).
- Email notifications enabled for failures.
- Retention: 14 daily database backups, 4 weekly file backups.
Layer 2: Server-Level WP-CLI Backups
- Cron job running
wp db exportevery 6 hours. - Exports uploaded to a second remote location (different from Layer 1).
- Retention: 7 days of 6-hourly database dumps.
Layer 3: Hosting Provider Backups
- Daily automated backups from the hosting provider.
- Treated as an emergency fallback, not a primary backup source.
Layer 4: Manual Pre-Change Backups
- WP-CLI or UpdraftPlus manual backup before every core, plugin, or theme update.
- Named with the operation being performed for easy identification.
Layer 5: Monthly Restore Test
- Full restore to a local or staging environment.
- Verify homepage, key pages, admin access, and plugin functionality.
- Document results and fix any issues discovered.
This layered approach means that even if one backup method fails — a plugin crashes, a cron job stops running, or a storage provider has an outage — you have multiple other copies to fall back on. For more on hardening your WordPress installation beyond backups, see our post on WordPress Security Hardening Checklist.
Disaster Recovery: When You Need to Actually Restore
Having backups is half the equation. Knowing how to restore quickly under pressure is the other half. Here is a step-by-step disaster recovery procedure:
Step 1: Assess the Damage
Before restoring anything, understand what happened:
- Site hacked? — You need a backup from before the compromise. Check your backups for the earliest clean copy.
- Plugin broke the site? — You may only need a database restore, or you may need to remove the plugin files.
- Hosting failure? — You may need to restore to a completely new server.
- Accidental deletion? — A database restore is likely sufficient.
Step 2: Restore the Database
# If WordPress is functional but data is wrong
wp db import backup-20260402.sql
# If starting from scratch on a new server
mysql -u root -p -e "CREATE DATABASE wordpress_db;"
mysql -u root -p wordpress_db < backup-20260402.sql
Step 3: Restore Files
# Extract wp-content backup
tar -xzf wp-content-backup.tar.gz -C /var/www/html/
# Restore wp-config.php
cp wp-config.php.backup /var/www/html/wp-config.php
# Set correct file permissions
find /var/www/html/ -type d -exec chmod 755 {} \;
find /var/www/html/ -type f -exec chmod 644 {} \;
chown -R www-data:www-data /var/www/html/
Step 4: Verify and Fix
# Flush rewrite rules
wp rewrite flush
# Verify core file integrity
wp core verify-checksums
# Check for database issues
wp db check
# Clear any cached data
wp cache flush
# Verify the site URL is correct
wp option get siteurl
wp option get home
Step 5: Document and Improve
After every restore, document what happened, what worked, what did not, and what you would change. This post-mortem is how backup strategies get better over time.
Common Backup Mistakes to Avoid
Even experienced WordPress developers make backup mistakes. Here are the most common ones:
1. Storing Backups Only on the Same Server
This is the most dangerous mistake. A server failure, hack, or account termination takes out both your site and your backups. Always use remote storage.
2. Never Testing Restores
A backup file that cannot be restored is worthless. Corrupted archives, incomplete SQL dumps, and missing media files are discovered only during restore testing -- or during an actual emergency.
3. Backing Up the Database but Not Files
Your database without your uploads, custom theme modifications, and plugin configurations is an incomplete site. Back up both.
4. Relying Solely on Hosting Provider Backups
Hosting backups are a convenience feature, not a business continuity solution. You need your own independent copies.
5. Not Monitoring Backup Success
Automated backups can fail silently. A cron job stops running, a storage provider's API key expires, a plugin deactivates after an update. Enable email notifications and periodically check that backups are actually completing.
6. Ignoring Backup Rotation and Retention
Without retention policies, either your storage fills up (blocking new backups) or you delete old backups manually and inconsistently. Configure automatic rotation: keep N daily, M weekly, and L monthly backups, then let older ones be automatically purged.
7. Forgetting wp-config.php and .htaccess
These two files are small but critical. They are often excluded from default backup configurations because they live outside wp-content. Add them explicitly to your backup scope.
WP-CLI Backup Commands Quick Reference
A consolidated reference for the WP-CLI commands you will use most often in your backup workflow:
# --- Database Operations ---
# Export full database
wp db export backup.sql
# Export with compression
wp db export - | gzip > backup.sql.gz
# Import database
wp db import backup.sql
# Import compressed database
gunzip < backup.sql.gz | wp db import -
# Check database integrity
wp db check
# List all tables with sizes
wp db size --tables
# Search-replace after migration
wp search-replace 'https://old-domain.com' 'https://new-domain.com' --all-tables --dry-run
# --- Site Information ---
# Get WordPress version
wp core version
# List all plugins with status
wp plugin list
# List all themes
wp theme list
# Export list of active plugins (useful for rebuilding)
wp plugin list --status=active --field=name > active-plugins.txt
# --- Maintenance ---
# Delete all transients (clean up before backup)
wp transient delete --all
# Optimize database tables
wp db optimize
# Verify core file integrity
wp core verify-checksums
Monitoring and Alerting
A backup strategy is only as good as your awareness of its status. Implement monitoring to catch failures early.
Email Notifications
Both UpdraftPlus and BlogVault support email notifications. Configure them to send alerts on both success and failure. Receiving a daily "backup completed" email is a positive signal; the absence of that email is an early warning.
Custom Monitoring with WP-CLI
Add a monitoring step to your cron-based backup script:
#!/bin/bash
BACKUP_FILE="/backups/daily-backup-$(date +%Y%m%d).sql.gz"
wp db export - --path=/var/www/html | gzip > "$BACKUP_FILE"
if [ $? -eq 0 ] && [ -s "$BACKUP_FILE" ]; then
FILESIZE=$(du -sh "$BACKUP_FILE" | cut -f1)
echo "Backup successful: $BACKUP_FILE ($FILESIZE)" | \
mail -s "WordPress Backup OK" admin@yourdomain.com
else
echo "BACKUP FAILED for $(date +%Y-%m-%d)" | \
mail -s "ALERT: WordPress Backup Failed" admin@yourdomain.com
fi
This script sends a success email with the file size (a sudden drop in size could indicate missing data) or a failure alert if the export command fails or produces an empty file.
Uptime Monitoring Integration
Services like UptimeRobot, Pingdom, or WordPress's own cron system can be configured to check that your backup files are being created on schedule. Write a simple health check endpoint that verifies the most recent backup exists and is within the expected time window.
Final Thoughts
A wordpress backup strategy guide can give you the knowledge, but only implementation gives you protection. The tools are accessible, the costs are low (or free), and the process can be automated almost entirely. What separates sites that survive disasters from sites that do not is whether someone took the time to set this up before it was needed.
Start with the basics: install UpdraftPlus, configure daily database backups to Google Drive, and test a restore on a local machine. Then layer in WP-CLI automation, add a second remote storage destination, and establish a monthly restore testing cadence. Each layer reduces your risk. Each test confirms your confidence is justified.
The cost of losing a WordPress site is measured in time, money, reputation, and stress. The cost of preventing that loss is a few hours of setup and a few dollars a month in storage. The math is straightforward. Do the work now.
Last modified: April 2, 2026









