How to Backup and Restore WordPress Database (2026 Guide)

How do you backup and restore WordPress database tables when something breaks? Your database holds every post, page, comment, setting and user, so a healthy copy can be the only way back after a bad plugin update, a hack or a mistake. The original author of this guide once broke his blog’s permalink structure and was saved by the previous day’s backup. Here is how to backup and restore WordPress database files in 2026.

Backup and restore WordPress database

Quick answer: For backups, use a plugin such as UpdraftPlus on a daily schedule with remote storage, or export the database in phpMyAdmin (Export > Quick > SQL). To restore, use the plugin’s Restore button, or in phpMyAdmin select the database, drop the old tables and Import the .sql file. Then clear your cache and check the site.

Files vs database: what needs backing up?

  • Database: posts, pages, comments, users, settings and plugin data. Changes daily.
  • Files: wp-content (uploads, themes, plugins) and wp-config.php. Back these up too, but less often.

How to back up your WordPress database

Method 1: A backup plugin (easiest)

  • UpdraftPlus: free scheduled backups of database and files to Google Drive, Dropbox, S3 and more, with one-click restore.
  • Jetpack VaultPress Backup: paid real-time backups with restores from the WordPress.com dashboard.
  • WP-DB-Backup: the simple database-only plugin this post first recommended. It still works for quick SQL downloads, but a full backup plugin is safer.

Set the database to back up daily and keep at least two weeks of copies off the server. See also the best Dropbox WordPress plugins for backups.

Method 2: phpMyAdmin export

  1. Open phpMyAdmin from cPanel or hPanel.
  2. Select your WordPress database (its name is in wp-config.php as DB_NAME).
  3. Click Export, choose Quick and format SQL, then Export. Save the .sql file.

Method 3: WP-CLI

wp db export backup-2026-10-12.sql

This writes a full SQL dump in the WordPress folder; download it and delete it from the server. Here’s how to schedule a daily WordPress database backup.

Method 4: Your host’s backups

Most hosts keep daily or weekly backups you can download or restore from the control panel. Useful, but keep your own copy too. Learn how to back up websites on your hosting server.

How to restore your WordPress database

With a backup plugin

In UpdraftPlus, open Settings > UpdraftPlus Backups, pick the backup date, tick Database and click Restore. If the dashboard is broken, install a fresh WordPress, add the plugin, upload the backup files and restore from there.

With phpMyAdmin

  1. Take a backup of the current, broken database first, just in case.
  2. Select your WordPress database, tick Check all and choose Drop to remove the damaged tables. This deletes them permanently.
  3. Click Import, choose your .sql file and click Import (or Go). Large files may need your host’s help or the zip format.
  4. Clear your cache plugin, CDN and the wp-content/cache folder.
  5. Log in and check posts, settings and permalinks.

With WP-CLI

wp db import backup-2026-10-12.sql
wp cache flush

Tips for safe restores

  • Restore to a staging site first if your host offers one.
  • Check the table prefix in the backup matches $table_prefix in wp-config.php.
  • If you moved domains, use a search-replace tool so old URLs are updated, never a plain text edit of serialized data.
  • Keep the database tidy afterwards: here’s how to optimize your WordPress database.

FAQ

How often should I back up my WordPress database?

Daily for active blogs, and always before updating WordPress, themes or plugins.

Will restoring the database delete new posts?

Yes. Anything added after the backup date is lost, so export recent posts first if you need them.

Does a database backup include images?

No. Images live in wp-content/uploads; back up files separately.

Originally written by guest author Udegbunam Chukwudi, who shared blogging and make-money-online tips on StrictlyOnlineBiz. Updated for 2026 by QuickOnlineTips.

Found this useful? Share it with someone who needs it.

Get our free weekly email: new tech guides and tools, no spam.

New and updated tech guides, a free tool worth bookmarking and one useful pick, once a week. No spam, unsubscribe anytime.

One email a week. Unsubscribe anytime. See our privacy policy.

Fresh Tech Guides

Leave a Reply

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

19 Comments

  1. Anyone here tried using the automatic backup through Dropbox? When restoring the WP backup it returns an error like this:
    #1064 – You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near ‘wordpress’ at line 5

    Been on this mess for 3 days already, and I’m desperately looking for the solution. If you have any idea, that would be highly appreciated. Thanks!

  2. thosand thnx thnx for this tutorial bro…i have created my backup..only one question i would like to know is what is the average size of backup…i was shocked to see that the bakup that i created is only 2 kb in size..plz help me out..

  3. Great tutorial! I had some problems with my site, but you solved the problem ;)
    I like tutorials with screenshots.

  4. Very nice… thanks for this article! I think it takes constant reminding to back up your database. I only had one copy of mine prior to reading this!

  5. i uploaded my database… but i can see only post and not the themes and plugins???

    what to do…???

  6. Your solution to backup a wordpress database is manual, or if you use the sending to email it does not manage the server maximum upload size. There are scripts like Website 2 Backup to do automated and encrypted website files and databases backup stored to ftp, emails, or locally.

  7. This is something very important for new bloggers who get into the trouble of messed up database sometime due to various plugins ;)

  8. Apparently this is one of the best ways to backup your wordpress website database tables. I have been using this plugin wp-backup since my very first installation. It is pleasant of you to demonstrate how all this works as many beginners are ignorant to backing up and restoring files and databae.

    – Hpnotik Qrew

  9. A lot of tutorials I have read related to this topic always contain numerous steps that ultimately deter me from really taking the whole process seriously. Hopefully, simpler is better. Thanks for sharing.

  10. BUT, sometimes database prefix name varies on a new wordpress installation.

    We have to make sure that the tables names match…

    One can find the table names in wp-config file under root.

  11. Back up is very important, i lost a years blogging because i was hacked. I recommend backing up your word press files too

  12. backing up is one thing we must never forget or else you’d regret it when unexpected thing happens

  13. It is important to back up your database on a regular basis. You never know when something could go wrong.

  14. If you are looking for a backup solution that is not manual – AKA one you will actually use – try the CloudBacks WordPress Backup Plugin. It backs up both files and database to Amazon S3 automatically daily, weekly, or monthly.

  15. This is nice tip for wordpress owners in the case when something goes wrong.