How to Backup Your WordPress Site (Files, Database, and Full Backups)

Overview

A WordPress backup is a copy of your site’s files and database that you can use to restore everything if something breaks. You need one before updating plugins, switching themes, migrating hosts, or any time you’re about to make significant changes to your site.

Most people discover they needed a backup after it’s too late. A plugin conflict, a botched update, or a hacked site can wipe out months of content in minutes. A solid backup routine takes 10 minutes to set up and can save hours of recovery work.

This article covers three approaches: a plugin-based backup (UpdraftPlus), a manual backup via cPanel, and a command-line backup using WP-CLI. Use whichever fits your setup — all three produce a usable restore point.

Prerequisites

  • Admin access to your WordPress dashboard (for plugin-based backups)
  • cPanel login credentials (for manual file and database backups)
  • SSH access and WP-CLI installed for command-line backups
  • Enough disk space to store the backup — check cPanel > Disk Usage before starting
  • A remote storage destination such as Google Drive, Dropbox, Amazon S3, or an SFTP server — storing backups on the same server as your site defeats the purpose

Method 1: Backup with UpdraftPlus (Recommended for Most Users)

UpdraftPlus is the most widely used WordPress backup plugin. The free version handles scheduled backups to remote storage and covers both files and the database. It’s what I’d recommend to anyone who doesn’t want to touch the command line.

  1. Install the plugin. In your WordPress dashboard, go to Plugins > Add New Plugin, search for UpdraftPlus, click Install Now, then Activate.
  2. Open the settings. Navigate to Settings > UpdraftPlus Backups, then click the Settings tab.
  3. Set your backup schedule. Choose a frequency for both Files backup schedule and Database backup schedule. For most sites, daily database backups and weekly file backups are sensible. Set retain this many scheduled backups to at least 3.
  4. Connect remote storage. Select your preferred destination (Google Drive, Dropbox, S3, etc.) and follow the authentication prompts. This step is critical — don’t skip it. A backup stored only on your hosting server is at risk if the server itself fails.
  5. Run a manual backup to test it. Click the Backup / Restore tab, then click Backup Now. Leave both Include your database in the backup and Include your files in the backup checked. Click Backup Now again to confirm.
  6. Verify the backup completed. Scroll down to the Existing Backups table. You should see a new entry with a timestamp and separate buttons for database and file downloads. If the remote storage upload failed, there’ll be a warning in the log — check it.

📝 Note: UpdraftPlus stores backups in /wp-content/updraft/ on your server before uploading them remotely. If your remote upload fails silently, those local copies are still usable — but don’t rely on them long-term.

Method 2: Manual Backup via cPanel

If you’re on shared hosting or a cPanel VPS, you can grab a full backup directly from the control panel without installing anything in WordPress. This is also useful if WordPress itself is broken and you can’t log in to the dashboard.

Back Up Your Files

  1. Log in to cPanel and go to Files > File Manager.
  2. Navigate to public_html (or the subdirectory where WordPress is installed).
  3. Select all files, click Compress, choose Zip Archive, and name the archive something like wp-files-backup-2026-01-15.zip.
  4. Once compressed, right-click the archive and click Download to save it locally.

⚠ Warning: Compressing large sites (5 GB+) inside File Manager can time out or consume significant server memory. For large installs, use the command line zip method or cPanel’s full backup tool instead.

Back Up Your Database

  1. In cPanel, go to Databases > phpMyAdmin.
  2. In the left panel, click the name of your WordPress database. If you’re unsure which one it is, check wp-config.php for the DB_NAME value.
  3. Click the Export tab at the top.
  4. Leave the format as SQL and the method as Quick, then click Export. This downloads a .sql file to your computer.

Use the Full Backup Tool (Easier)

cPanel also has a full backup generator that packages everything in one shot:

  1. Go to Files > Backup (not Backup Wizard).
  2. Under Full Backup, click Download a Full Website Backup.
  3. Set the destination to Home Directory, enter your email, and click Generate Backup.
  4. You’ll get an email when it’s done. Download the .tar.gz file and move it off the server.

📝 Note: Full cPanel backups are not directly importable into WordPress — they’re a system-level archive. They’re great for disaster recovery but you’d restore files and the database separately from them.

Method 3: Backup via WP-CLI (Developers and Sysadmins)

WP-CLI is the fastest method if you have SSH access. It’s precise, scriptable, and doesn’t depend on the WordPress dashboard being functional.

  1. SSH into your server and navigate to your WordPress root directory:

    cd /home/yourusername/public_html
  2. Export the database:

    wp db export backup-$(date +%F).sql --allow-root

    This creates a timestamped SQL dump in your current directory. The --allow-root flag is only needed if you’re running as root.

  3. Archive the WordPress files:

    tar -czf wp-files-backup-$(date +%F).tar.gz /home/yourusername/public_html
  4. Move both files off the server using SCP or rsync to a remote backup destination:

    scp backup-2026-01-15.sql backup@remotehost:/backups/
    scp wp-files-backup-2026-01-15.tar.gz backup@remotehost:/backups/

You can wrap steps 2 and 3 into a cron job to run nightly. I’d recommend doing that over relying on any plugin for mission-critical sites.

How to Restore a WordPress Backup

Restore with UpdraftPlus

  1. Go to Settings > UpdraftPlus Backups > Backup / Restore.
  2. In the Existing Backups table, find the backup you want and click Restore.
  3. Select what to restore: Plugins, Themes, Uploads, Other files, and Database. For a full restore, check all of them.
  4. Click Restore and wait. Don’t close the browser window during this process.

Restore the Database via WP-CLI

wp db import backup-2026-01-15.sql --allow-root

⚠ Warning: This overwrites your current database entirely. Make sure you’re importing into the correct database and that the SQL file came from the same WordPress install (or that you’ve updated the site URL if migrating).

Common Issues and Troubleshooting

UpdraftPlus backup completes but remote upload fails

Usually caused by an expired OAuth token or revoked API access on the remote storage account. Go to Settings > UpdraftPlus > Settings, disconnect and reconnect your remote storage, then run a fresh backup. The local copy in /wp-content/updraft/ is still intact in the meantime.

phpMyAdmin times out during database export

This happens with databases larger than roughly 200–300 MB. phpMyAdmin has execution time limits that cPanel can’t always override. Use WP-CLI or mysqldump over SSH instead:

mysqldump -u db_user -p db_name > backup-$(date +%F).sql

Restored site shows a blank page or 500 error

The most common cause is a mismatched WordPress version or a plugin that was active at backup time but is now missing. Check /wp-content/debug.log (enable WP_DEBUG_LOG in wp-config.php if it’s not there). A broken .htaccess is also a frequent culprit — try replacing it with the default WordPress version.

cPanel full backup is stuck generating

Large accounts can take 30–60 minutes to generate a full backup. If it’s been longer than that, check cPanel > Background Processes or contact support. On Host & Tech VPS plans, you also have SSH access to run the backup manually if cPanel’s backup tool is unresponsive.

WP-CLI db export produces an empty or corrupted file

This typically means the database credentials in wp-config.php don’t match the actual database user permissions. Verify with:

wp config get DB_USER
wp config get DB_NAME
mysql -u DB_USER -p DB_NAME -e "SHOW TABLES;"

If SHOW TABLES returns nothing or throws an access denied error, the DB user is missing permissions — fix that in cPanel under MySQL Databases.

A Note on Managed WordPress Hosting

If you’d rather not manage backups yourself, Host & Tech’s Managed WordPress Hosting includes automated daily backups with one-click restore. It’s worth considering if you’re running an e-commerce site or anything where downtime has a direct cost.

Frequently Asked Questions

How often should I backup my WordPress site?

Daily database backups and weekly full file backups are a reasonable baseline for most sites. If you’re running an online store or publishing content daily, daily full backups are worth the extra storage cost. The real question is: how much data can you afford to lose?

Does WordPress have a built-in backup feature?

No. WordPress core doesn’t include a backup tool. You’ll need a plugin like UpdraftPlus or Duplicator, a hosting-level backup from cPanel, or a manual process via SSH and WP-CLI. Some managed WordPress hosts include automated backups as part of their plans.

What files do I actually need to backup in WordPress?

You need two things: your database (which holds all your posts, settings, and users) and your wp-content folder (which holds your themes, plugins, and uploaded media). The core WordPress files in wp-admin and wp-includes are replaceable from wordpress.org — you don’t need to back those up separately.

Can I restore a WordPress backup to a different host?

Yes, but you’ll need to update the site URL in the database after importing. If the domain is different, run wp search-replace 'https://oldsite.com' 'https://newsite.com' via WP-CLI after the database import. Skipping this step causes broken links and redirect loops.

Is a cPanel backup the same as a WordPress backup?

Not exactly. A cPanel full backup is a server-level archive of your entire hosting account — it includes your WordPress files and database, but it’s packaged in a .tar.gz format that you’d extract and restore manually. A WordPress-specific backup (like one from UpdraftPlus) is formatted for easy one-click restore inside the WordPress dashboard.

SHARE THIS ARTICLE

Need help with your hosting?

Host & Tech provides 24/7 support for all VPS, dedicated, and shared hosting customers.

Scroll to Top