How to back up WordPress: files and database, step by step
To back up WordPress, you need to copy two parts: the site files (the folder where WordPress is installed, mainly wp-content and wp-config.php) and the MySQL database, which stores posts, pages, users, and settings. You can do this through cPanel by exporting the database with phpMyAdmin and compressing the files, or with a backup plugin that does everything at once.
This article is for anyone with a WordPress site on cPanel hosting who wants a safe copy before updating, migrating, or changing files. It covers the three methods, what to copy, where to store it, how often to repeat it, and how to restore it.
What does a WordPress site backup include?
A complete backup always has two parts. If one of them is missing, the copy won’t restore the whole site.
| Part | What it contains | Where it is |
|---|---|---|
| Files | Themes, plugins, uploaded images (wp-content), wp-config.php, .htaccess |
Site folder, in File Manager or via FTP |
| Database | Posts, pages, comments, users, settings, plugin data | MySQL, accessible through phpMyAdmin |
The database is the part most often lost by accident: without it, the files alone restore the look but not the content. The WordPress core files (the wp-admin and wp-includes folders) can be downloaded again from wordpress.org, but it’s more practical to keep the whole folder.
Which backup method should you choose?
| Situation | Recommended method |
|---|---|
| You want a quick copy before an update | cPanel (Backup) or phpMyAdmin plus a ZIP of the files |
| You want automatic, scheduled copies | Backup plugin |
| You’re moving the site to another host | Files plus a manually exported database, or a migration plugin |
| The WordPress dashboard won’t open | cPanel or phpMyAdmin, which don’t depend on it |
How do you back up WordPress through cPanel?
cPanel lets you download a copy of the site folder and databases without installing anything. Options vary by host, so check what appears in your panel.
- Log in to cPanel and open Backup (in the Files section). If your panel has the Backup Wizard, it will guide you through the same steps.
- Under Download a Partial Backup, click your database name under MySQL Databases to download the
.sql.gzfile. - On the same screen, click Home Directory to download a compressed copy of your account’s files, or compress only the site folder, as shown in the next section.
- If your panel offers Download a Full Account Backup, it generates a copy of everything, and cPanel emails you when it’s ready. On some hosts this option is not available.
Store the downloaded file somewhere other than the site’s server.
How do you copy the WordPress files?
If you only want the site folder, compress it in File Manager:
- In cPanel, open File Manager and go to the site folder. On a primary domain, it’s usually
public_html. - Select everything (or the site folder, if it’s inside another folder), click Compress, and choose Zip Archive.
- Give it a name with the date, for example
site-2026-11-21.zip, and confirm. - Right-click the generated file and choose Download.
If the site is large, compression can take a while, and downloading via FTP is an alternative. The article how to create and access FTP accounts in cPanel with FileZilla shows how. Remember to select Show Hidden Files in the File Manager settings so the .htaccess file is included in the copy.
How do you export the database with phpMyAdmin?
phpMyAdmin exports the entire database to a .sql file.
- In cPanel, open phpMyAdmin.
- In the left menu, click your site’s database. If you’re not sure which one it is, open
wp-config.phpand look for theDB_NAMEline. - Click the Export tab.
- Leave the method as Quick and the format as SQL, then click Export.
- Your browser downloads a
.sqlfile. Rename it to include the date, for exampledatabase-2026-11-21.sql.
To make sure the copy is complete, open the file in a text editor: it should contain CREATE TABLE and INSERT INTO statements, with the table names of your WordPress installation (such as wp_posts, whose prefix may be different).
How do you back up WordPress with a plugin?
A backup plugin makes both copies at once and can schedule them. There are several, such as UpdraftPlus, Duplicator, and All-in-One WP Migration, each with its own features and limits in the free version. The process is usually similar:
- Install and activate the plugin under Plugins > Add New. If you need help, see how to install a plugin in WordPress.
- Open the plugin settings and choose what to include: database, plugins, themes, and uploads.
- Set the schedule (for example, daily or weekly) and how many copies to keep.
- Choose an external destination, such as a cloud storage account, instead of keeping the copy only on the server.
- Run a manual backup and confirm that the file was created.
The weak point of a plugin is that it depends on the WordPress dashboard: if the site goes down, you need cPanel or phpMyAdmin to restore it. For that reason, it’s worth having at least one recent manual copy. Backup plugins also use server space and resources, so check the limits of your plan.
Where should you store the WordPress backup?
A copy kept only on the site’s server is lost along with it if there’s a break-in, a serious error, or a problem with the account. Follow the rule of keeping the copy in more than one place:
- One copy on your computer.
- One copy in a cloud storage service or on an external drive.
- File names with dates, so you know which is the most recent.
Because the database may contain customer data, and wp-config.php stores the database credentials, treat the backup as sensitive information: protect the location where it’s kept with a password, and don’t leave it in a public folder of the site.
How often should you back up?
How often depends on how much new content the site gets and how much you can afford to lose:
| Type of site | Suggested frequency |
|---|---|
| Corporate site that rarely changes | After every important change and before updates |
| Blog with weekly posts | Weekly, plus before updates |
| Online store or site with forms and sign-ups | Daily for the database, which changes with every order |
In any case, make a manual backup right before you update WordPress, themes, or plugins, switch hosts, or edit files such as wp-config.php and .htaccess. The full procedure is in how to update WordPress, themes, and plugins safely.
How do you restore a WordPress backup?
Restoring replaces the current site with the copy, so before restoring, download the files and the database as they are now, even if they’re faulty. That way you can undo changes or retrieve anything from them later.
- Database: In phpMyAdmin, click your site’s database and open the Import tab. Choose the
.sqlfile and click Import. If the file is larger than phpMyAdmin’s upload limit, the.sqlfile can be compressed as.zipor.gz, and phpMyAdmin accepts those formats. When you import over a database that already has tables, the old content can be overwritten, so confirm that you made a copy of the current state. - Files: In File Manager, upload the
.zipto the site folder and use Extract. To avoid mixing new and old files, rename the current folders instead of deleting them. - Check: Open the site and the dashboard, and check posts, images, and links.
If the backup was made with a plugin, use the restore function of the plugin itself, or follow the steps above if the dashboard is down. cPanel also has restore options on the Backup screen, depending on the host. If the site goes down after the restore, see 500 error or white screen in WordPress.
If the site is moving to another server, the process is similar. The article how to migrate a WordPress site to MigraCloud explains the process, and migration is free for clients. If you have questions, contact MigraCloud.
Frequently asked questions
What do I need to copy to back up WordPress?
Two things: the site files (mainly the wp-content folder, wp-config.php, and .htaccess) and the MySQL database. Without the database, you lose posts, pages, and settings. Without the files, you lose themes, plugins, and images.
How do you back up WordPress without a plugin?
By exporting the database with phpMyAdmin and compressing the site folder in cPanel’s File Manager, then downloading both files. You can also use the cPanel Backup screen if your host offers it.
Does the WordPress backup include the database?
Only if you include it. A copy of the site folder alone doesn’t have the content, because the content is stored in the database. Check that your backup has a .sql file or that the database option is selected in the plugin.
How often should you back up WordPress?
It depends on how much the site changes. A site that rarely changes can be backed up after every change and before updates; a blog, weekly; an online store, daily for the database. Always make a copy before updating or changing files.
Where is the best place to store the WordPress backup?
Outside the site’s server: on your computer and in a second location, such as cloud storage or an external drive. A copy kept only on the same server is lost along with the site.
How do you restore WordPress from a backup?
Import the .sql file through the Import tab in phpMyAdmin, and extract the files .zip into the site folder in File Manager. Before doing that, download a copy of the current state so you can go back if needed.
Can I back up if the WordPress dashboard won’t open?
Yes. cPanel and phpMyAdmin don’t depend on WordPress: you can download the database and compress the files even when the site is down, and you should do this before attempting any fix.
Does a backup plugin replace a manual copy?
It helps a lot, but it doesn’t fully replace one. If the plugin doesn’t run or the panel goes down, you need a recent manual copy and a destination outside the server. The ideal is to combine both.