How to Backup WordPress Website?

What a Complete WordPress Backup Must Include

How To Backup WordPress Website - SiteHale

A WordPress site has two separate parts, and a usable backup needs both. Saving only one leaves you unable to restore the site.

  • The database stores your posts, pages, comments, user accounts, plugin settings, and theme customizer options. It is usually a MySQL or MariaDB database, and its name is listed in the DB_NAME line of your wp-config.php file.
  • The files include the wp-content folder, which holds your uploads (images, PDFs), themes, and plugins, plus two critical root files: wp-config.php, which holds database credentials and security keys, and .htaccess, which holds permalink and redirect rules.

The core WordPress files in wp-admin and wp-includes can be re-downloaded from WordPress.org, so some backup tools skip them to save space. Your uploads folder is the one that cannot be recreated, because every image you have ever added lives in wp-content/uploads, sorted by year and month.

Store at least one copy somewhere other than your hosting server. If the server fails, gets hacked, or your hosting account is suspended, a backup sitting in the same account disappears with it.

Step-by-Step: Automated Backups with UpdraftPlus

  1. Install the plugin. In your dashboard, go to Plugins > Add New Plugin, search for UpdraftPlus, click Install Now, then Activate. The free version covers scheduled backups and cloud storage.
  2. Open the settings. Go to Settings > UpdraftPlus Backups and click the Settings tab.
  3. Set your schedules. Use the Files backup schedule and Database backup schedule dropdowns. Weekly files and daily database backups work well for a blog. For a WooCommerce store, back up the database every 4 to 12 hours, because orders arrive constantly. Set the retention number beside each schedule to how many copies to keep. Seven to fourteen is typical.
  4. Choose remote storage. Under Choose your remote storage, click Google Drive, Dropbox, or Amazon S3. Click Save Changes at the bottom, then follow the authorization link that appears to connect your account.
  5. Run and verify a first backup. Return to the Backup / Restore tab, click Backup Now, and keep both the database and files boxes checked. When it finishes, confirm that the backup appears under Existing backups and that its files show up in your cloud storage folder.

Manual Backup Through cPanel and phpMyAdmin

A manual backup is useful before a major change, or when a plugin crashes your dashboard and you cannot log in.

Back up the files: Log in to cPanel and open File Manager. Navigate to your site root, usually public_html or a folder named after your domain. Select all files, right-click, choose Compress, and pick Zip Archive. Once the zip is created, right-click it, choose Download, and then delete the zip from the server so it does not take up disk space or become publicly downloadable.

Back up the database: In cPanel, open phpMyAdmin. In the left sidebar, click the database whose name matches DB_NAME in wp-config.php. Click the Export tab, leave the method on Quick and the format on SQL, and click Export (labeled Go in older versions). A .sql file downloads to your computer.

If you have SSH access: WP-CLI is faster. From the site root, run wp db export backup.sql to export the database, then run tar -czf site-files.tar.gz wp-content wp-config.php .htaccess to archive the essential files.

Name both files with the date, such as example-2024-06-01.sql, so you can find the right version during a restore.

Tips for Backups You Can Actually Restore

  • Test a restore every few months. A backup that has never been restored is unproven. Many hosts offer one-click staging sites. Restore your latest backup there and click through a few pages, checking images and forms. This often reveals problems such as zero-byte archives, missing upload folders, or database exports that timed out halfway on large sites.
  • Back up immediately before updates. Theme, plugin, and WordPress core updates are the most common cause of broken sites. Run Backup Now first, or check the UpdraftPlus option that offers a backup before updates. Rolling back then takes minutes instead of hours.
  • Keep archives lean and separate. Exclude cache folders such as wp-content/cache, and old backup folders such as wp-content/updraft, from file backups. Leaving them in can double archive size and cause timeouts on shared hosting. Follow the 3-2-1 rule: keep three copies, on two different types of storage, with one copy off-site. For example, keep one in Google Drive and one on an external drive at your office, in addition to your host’s own snapshots.

Does Your Site Have This Problem?

Every check in this article runs automatically on the sites we look after. You can run the same health checks on your own site in seconds with the free SiteHale plugin — no account, nothing transmitted anywhere. Or have us do it: we’ll crawl your site and send you a written report, free.

Get My Free Site Report

Proven on our own sites first

Every automation runs on our own sites before any client site

25+ years in IT

Built by a 25-year professional IT team

$49/mo flat

Everything included — no tiers, no upsells

Leave a Comment