Beginner's Guide for WordPress - Start your WordPress Blog in minutes.
Choosing the Best
WordPress Hosting
How to Easily
Install WordPress
WordPress Plugins
View all Guides

Beginner’s Guide: How to Restore WordPress from Backup

Last updated on by
Special WordPress Hosting offer for WPBeginner Readers
Beginner’s Guide: How to Restore WordPress from Backup

Even on the Internet, bad things can happen to good people. This is why we keep reminding you to back up your websites. We have written about different methods to backup WordPress such as: manual backup, BackupBuddy, BackWPup, and VaultPress. Now that you have a WordPress backup, you need to know how to use it in case of emergencies. In this guide, we will show you step by step guide on how to restore WordPress from backup. You will need to restore WordPress in case a disaster strikes your website such as getting hacked or infected by malware, loss of data, cancellation of services by web host, etc.

Note: This guide is for restoring WordPress from backup. If you are trying to move your WordPress website to a new domain, then you should check out our guide on moving WordPress to a new domain without losing SEO. If you are trying to move from local host to a live web hosting account, then follow this guide on how to move WordPress from local server to live site.

Understanding Backups and Restoring WordPress

There are different ways to create backups. You can use plugins to create database backups or full site backups. You can also create manual backups. Restoring WordPress from those backups depends on how you created them. For example backups created using BakupBuddy can be restored by using the same plugin. Manual backups need to be manually restored. A lot of WordPress users don’t backup their entire websites, instead they only back up their theme, uploads directory, and their WordPress database. This reduces their backup size, but increases the steps needed to restore the site.

No matter how created your back up, the basic steps are the same. First you need to clean your WordPress files. The best way to do this is delete everything from your web server using an FTP client. Next, you need to restore the database, install fresh copy of WordPress and the plugins you had, then lastly restore your theme and images.

Restoring WordPress from BackupBuddy Backup File

BackupBuddy offers a very convenient way to restore WordPress from a backup. If you are using BackupBuddy to backup your website then login to your WordPress website and go to BackupBuddy » Restore/Migrate. Download a copy of importbuddy.php. You will be asked to provide a password for importbuddy. This password will be used when you restore your website.

Download a copy of your backup. You can download it from BackupBuddy » Backups or the destination that you used to store your backups.

Once you have the backup zip file and importbuddy.php stored on your computer, connect to your website using FTP. If you have a complete backup of your website, then delete all files and folders from your server. However, if you have a partial backup then you may want to first download the files that you haven’t backed up. For example, files in your /wp-content/uploads and /wp-content/themes directory. Once you are sure that you have everything backed up, proceed deleting all files and folder from your website’s root directory.

Upload your BackupBuddy backup and importbuddy.php files. Once both files are uploaded to the server, visit importbuddy.php in your web browser. It is in your website’s root directory so its URL will be something like:

ImportBuddy will now ask for the password that you created when you downloaded ImportBuddy.

Provide importbuddy password to start restoring

On the next screen, ImportBuddy will display the backup file you uploaded. In case you did not upload your backup file using FTP, then you can click on upload tab to upload the backup file now. If you have your backups stored on iTheme’s Stash storage service, then you can connect to it by clicking on stash tab now. Once you have selected your database, click on Next Step to continue.

Select the backup file to restore

ImportBuddy will unzip your backup file and show you a success message when it has extracted the files. Click on the next step button to continue. On the next screen, ImportBuddy will ask you to provide site URL and Database information. If you are moving from one domain to another, or a local server site to a live site, then you will need to update the site URL. If you are simply restoring a WordPress site then it will already be set to use your current URL.

Provide site URL and Database information

If you are restoring a hacked WordPress website or trying to remove malware, then you do not want to use your old database if it already has WordPress installed. You can either drop tables from your old database using phpMyAdmin, or create a new database using cPanel. Once you are done creating a new database or emptying the old one, provide your database details. If you are restoring to your old database then Import Buddy may have already filled these fields for you. Test your database settings and then click on next step to continue.

ImportBuddy will now import your database once it is done, click next step to continue. Now ImportBuddy will update your site URLs paths etc. Once it is done, you will be asked to test your site. If everything is working fine, then you have successfully restored your website. On the importbuddy page click Clean up and remove temporary files button. This will delete temporary data in database and files created during restoration.

Restoring WordPress Database from Backup using phpMyAdmin

When restoring a manually created backup, you may come across two possible choices. You can either create a new database and import your backup into it, or you can empty your existing database and import backup. If you are cleaning a hacked WordPress website, then it is very important to change your MySQL username and password before creating a new database or importing into existing database.

To empty your existing database, log in to your cPanel account (Your web host may have some other solution), scroll down to databases section and then click on phpMyAdmin. This will open phpMyAdmin in a new browser tab. Click on your database, and select all tables. From the drop down to your right, click drop selected tables, as shown in the image below:

Emptying an existing WordPress Database

Now if you were creating a new database, then simply log in to your cPanel account. Scroll down to the databases section and then click on MySQL databases.

Creating a database using cPanel

On the next screen simply provide a name for your new database and hit create database button.

Create new database

Once you have a clean database OR a new database, click on the import tab on the top in phpMyAdmin. This will take you to the import page where you can click on choose file and the select the database backup from your hard disk. . After choosing your back up file, click on the Go button at the bottom of the page. phpMyAdmin will now import your database.

Restoring WordPress Database Backup using cPanel

If you manually created a WordPress database backup using cPanel, then you can also restore that database using cPanel. Log into your cPanel account and scroll down to files section and click on Backups.

Restoring backup in cPanel

On the backups page scroll down to Restore a MySQL database backup. Click on choose file and select the backup file from your hard disk. Once done, click on the upload button.

Restoring MySQL database backup in cPanel

Manually Restoring WordPress Files using FTP

If you are restoring a WordPress website to clean up a hacked site or to remove malicious code, then you should know that it would work best if you delete every thing on your website first. Delete all WordPress core files and directories. Only do this if your backup is up to date, and has everything you have customized, changed, or uploaded on your website. If you do, then you can delete every thing on your website using cpanel (way faster), or using FTP.

To delete all files from your website using cPanel, log in to your cPanel dashboard and scroll down to Files section. Click on File Manager, which will then ask you for directory selection. Choose Web root and proceed. File manager interface will now open in a new tab in your browser. Select all WordPress files and delete them.

cPanel File Manager

To delete files using FTP, simply connect to your website using an FTP client such as FileZilla. Select all files in your WordPress root directory and delete them.

Deleting files using FTP

Now before you start uploading files from your backup, make sure that the back up you have is clean. If you are restoring a website that had malware or was hacked, then you need to make sure that no exploited file or backdoor is present in your backup files. This is why we would recommend that you only upload your images and theme from your backup.

Download a fresh copy of WordPress from and extract it to your hard disk. Open the local directory in FTP, select all files, and upload them to your website.

Uploading a fresh copy of WordPress using FTP

Once you have uploaded WordPress files, you can upload your wp-config.php file from your backup (if you are sure that it is clean and not compromised). Alternately, you can rename wp-config-sample.php file in your freshly uploaded WordPress files to wp-config.php file. Right click and edit wp-config.php file. Provide your host, database name, database username and password information (you can find this in your old wp-config.php file). If you changed your MySQL user’s password then use new password here. Save the file and upload it back to your website.

Now you need to upload other files from your backup. We will recommend that you only upload your images in /wp-content/uploads/ directory and your WordPress theme. Once you have uploaded these, visit your website to check that every thing is working fine. Also log in to your WordPress admin area.

So far we have restored database and files. Now you need to download fresh copies of the plugins you had on your site. Simply install and activate them one of by one. Lastly, go to Settings » Permalinks and adjust permalinks settings to your old site and then update permalinks.

Troubleshooting WordPress Backup Restore Issues

There are some common problems that you may come across when restoring your WordPress website. We have separate guides for each of them.

Things to do After Restoring your WordPress Site

Once you have successfully restored your website, you need to make it secure. First create a backup and schedule regular automated backups. For securing your website, we will recommend that you immediately change your WordPress password. If you are running a multi-user website then ask all users to update their passwords immediately. Secure your WordPress by making your admin area password protected. Enable Google 2-step authentication to add an extra layer of login seurity for your site. At WPBeginner we use Sucuri to monitor and strengthen security of our website. It monitors for security threats, and they also offer malware removal service with their subscription plans. Here are 5 reasons why we use Sucuri.

We hope this guide helped you restore WordPress from backup. If you run into a problem or have feedback for us, then please leave a comment below.

Editorial Staff at WPBeginner is a team of WordPress experts led by Syed Balkhi. Page maintained by Syed Balkhi.

WPBeginner's Video Icon
Our HD-Quality tutorial videos for WordPress Beginners will teach you how to use WordPress to create and manage your own website in about an hour. Get started now »


  1. Hari Kumar says:

    My blog is live and can login to admin dashboard. but none of my post is available, and I cannot update my previous post. Plus new post added are not found… while opening.. it says —- a 404 Not Found error was encountered while trying to use an ErrorDocument to handle the request.
    Any Solution??

  2. Jamie says:

    Thanks for the information. Just a question: I have a SQL database backup for my blog saved as a .SQL file. What information does this contain? Does it have the theme customised layout? Blog articles? Pictures?

    Many thanks

  3. Soibibo says:

    My site just crashed. I can’t access my wp admin dashboard. What do you suggest I do?

  4. Mr. Karmaker says:

    My website has been hacked. I have made earlier backup zip file in cPanel FileManager. Zip file size is more than 99MB and it can not upload.
    How to restore my site ?
    Any suggestion please.

  5. dana says:

    Hi, We recently moved some but not of our blog content from a standalone site to the company website. The posts that we didn’t think we wanted are now in FTP — I’d like to import them to a new wordpress site. Trying to locate specific content within FTP Is a huge pain. Is there any way to export that content into a new wordpress site so I can access it? Thank you.

  6. Prudhvi Raj says:

    I’ve backed up Home Directory and restoring it, and also uploaded the whole website. it’s like 20 minutes it is saying “restoring files…” . How long does it takes? File is of 1.45GB . Thanks .

  7. Mufaddal says:

    Hi there, I want to change my hosting plan from hostgator(HG) to Digitalocean(DO). I have done the setup of DO successfully, how can I get my backup uploaded?
    I have taken a backup of WP site(the file was around 32mb) I m not sure its the whole backup, now my HG plan has expired(not deleted, I can renew it to get my site back) but now what should I do to upload the data, on adminMyPhp it is showing some error while uploading data. I want my site back as it was, on DO server, I dont want to renew my HG plan again, Please guide me, Thank you in advance.

  8. Keesjan says:

    do you know how to restore a backup when the admin interface is broken?
    Then its not possible to use the interface.

    Is in that case only the phpadmin method the way to go. Or are there any cloud service out there that help me ‘push’ teh bakcyp back to my site, without loggin in mt wp admin?

    • WPBeginner Support says:

      You will have to do it manually. You can also hire professionals to do that for you. They will also take the phpMyAdmin approach.

  9. Mahriya says:

    Thanks, what if I had backed up my whole WordPress site(tags, posts media etc…) but only wanted to restore the Media only. Is there any way to do this? I appreciate the help!

    • WPBeginner Support says:

      It depends on what method you used to create a backup. Most WordPress backup plugins store all your WordPress files in a zip file. You can extract that file to your computer and then upload the wp-content/uploads folder.

  10. Belinda says:

    Total beginner here.
    Started building my first WordPress site for a client on my local drive. Used the theme Avada.
    Long story short, I needed a new hard drive in my Mac.
    – Backed up my failing hard drive with time machine.
    – Starting fresh on my computer with a new hard drive.
    – Reinstalled WordPress and MAMP.
    – Moved the website files from time machine applications/MAMP/htdocs to the same place on my computer.

    Reading above I need to do something with the database. But I am completely lost on this.

    Please help as soon as possible!

    Thank you in advance.

    • WPBeginner Support says:

      Go to Applications/MAMP/db/mysql/ copy the contents and paste them in your new drive MAMP install on the same location.

  11. tonythanh says:

    The problem when we restore wordpress is all image will not display. I have already got this trouble and it made me 3 days for resolve. Here is the way I solve for my site

    1. Install fresh copy of wordpress with new database
    2. Drop all database in phpmyadmin
    3. Import database that you back up lastime
    4. Your site will not work and It need reinstall. Don’t worry.
    5. Login Cpanel, find the wp-config.php file, open, change the prefix wp_ with your new prefix of your last database.
    6. Import your images correct to the folder in uploads.
    7. Done, your site will work well with full images.

    I hope you will get no trouble like me.

  12. Graceson says:

    Can you please assist me to restore backedup files using “BACKUPWORDPRESS” in my local drive?

    Thanks in advance.

  13. Tushar says:

    Is the method of using FTP to restore your website valid/useful if the main error in FTP is “552-Quota exceeded” . I contacted the host, he says that some malicious plugin has caused this sort of error to occur and complete restoration of the site will be required. I planning to begin from a clean slate by uploading new wordpress and redesigning the entire site: But will this work with above mentioned error?

  14. Angel says:

    Thanks a lot for the article! You saved my life helping me to restore a site, easy and simple!
    All the best, Angel

  15. Paul says:

    Hi, just a (probably) silly question: can I Re-install now from the wordpress dashboard without losing any settings etc on my site?

    • WPBeginner Support says:

      You can go to Dashboard -> Updated and click on reinstall now button. That will download a fresh copy of WordPress and replace your old files. It will not change your WordPress settings as those are stored separated in database.

  16. Ben Dixon says:

    Hi guys, very informative read, thanks for that!

    I have a backup of my SQL database which was created with a plugin and emailed to me. Unfortunately I’ve lost all other files, I’ve contacted my host and they have no backup.

    I’ve installed WordPress and will install the appropriate theme. I can’t recall all the plugins I used.

    I’ve obviously lost all my images, but what else have I lost? Is a restore of my site feasible in your opinion?

    Many thanks for any help at all.

    • WPBeginner Support says:

      Yes a restore of your site is feasible.

      Since you do not have backup of your files, so you will be unable to restore images. Some plugins may also misbehave.

      • Ben Dixon says:

        Thanks for that, I’ll give it go. Maybe I can look at the database to help me remember what plugins were there before.

        Cheers guys!

  17. Ali Sajjad says:

    Hi, i have done everything and my site is running fine. but i have problem with images all over the site. i don’t know why, because there is no error display during restore process.

  18. Zamby says:

    Somewhat complicated question. A few days ago, I updated the wordpress version my site was using. This then made the site fail, and I couldn’t even log in to wordpress due to a fatal error. I then replaced the site with my most recent backup from Feb. 2nd, and things were fixed. However, there is a lot of data from Feb. 2nd that I would like to access if possible.

    This data must have been saved somewhere, but I’m wondering where? Or is it all completely lost and innaccessible in the Cpanel after a backup?

    • WPBeginner Staff says:

      It actually depends on how you restored your backup. If you created a new database to restore your backup into and did not delete any files from your webserver then you can get access to your posts by opening the old database using phpmyadmin. You can also find the files you uploaded on your webserver by connecting to your site using an FTP client. These file uploads will be stored in /wp-content/uploads/ folder.

      On the other hand, if your restoration process involved deleting old database by emptying it, and if you deleted old files from server as wel, then you cannot access those files on your own.

      Another possibility to recover that data is by requesting your web host and ask them if they have a backup for your site on the specific date when you deleted all old data. If they have the backup, then they can send it to you.

  19. WPBeginner Staff says:

    Simply click on Appearance » Themes and click on the activate button on the theme that you had previously installed. In case you can’t figure out which theme you had previously installed, then you will need to activate them one by one and preview your website until you get the right theme.

    • Urgent help needed @ WPBEGINNER SUPPORT says:

      Good day Wpbeginner,

      This is my terrible situation. I made a mistake and i lost my site. and then i requested my Host gator India to give back file for which i paid. They send me in TAR.Zip file. I don’t know how to go about it. They told me to long CP panel and upload and extract. But it didn’t work. Then one rep who helped me and my site came alive. However, if i click any one of the posts it was throwing 403 error. She couldn’t solve it. and another rep said i need to contact my developer…what is this? Develper,!!!(lol)

      and then i moved another host. I tried uploading my back up file. but no use and nothing working. So i had 3 months back up files which i downloaded from WordPress XML. Now it is working except images and the current template is different than the previous.

      I have the back up file from Hostgator and if you could help me how to go with it…i really appreciate.

      Best regards,

      • WPBeginner Support says:

        You can extract the backup file on your own computer using a program that is able to extract .tar and .zip archives like 7zip. After that you can browse the files and upload them to your web server using an FTP client.

  20. Timothy says:

    I was wondering how to recover a WordPress theme, it wasn’t deleted I just hit active on a new on by accident

  21. Gary says:

    Hello, I just stumbled upon this post and was wondering if you could help. I switched hosting plans within godaddy and went from managed wordpress to cpanel. I used a plugin to backup the site before switching, which saved all files including the .sql file. Restoring the site via the plugin did not work so I am trying it the hard way. I have completely removed the site including all files. Then I created a new database and gave it the same name as database_name in the .sql file. Afterwards I uploaded the .sql file from the backup into this database. Then I reinstalled wordpress via cpanel and chose the new database I created. Then I uploaded the rest of the files(themes, plugins, uploads) via ftp. But for some reason this did not do anything. When I logged into wordpress nothing looks different. None of the pages I created or anything was there. The plugins were there and the theme I uploaded was there. However, I can’t access the images from the media button even though they are in the uploads folder. I can’t figure out where I went wrong. The database names match up, I can’t think of anything else. The only thing I can possibly think of is the hostname in my .sql backup file is not localhost. Could that be the issue? I can’t figure out what I am missing. Any help would be greatly appreciated.

    • DFPhoenix says:

      If your database was correctly restored, you won’t even need to install wordpress again. Asking you to install means, your database isn’t correctly restored. Just my guess.

  22. Dill says:

    Hi… I was wondering how to restore my wordpress site if all I have is a complete download of everything that was there. I downloaded everything (everything!) from my host using FTP and didn’t do any fancy backups of databases. Can I just upload that entire backup as is and get the site back? I’m also switching hosts (but not domain names), so I do know I’ll have to edit a file or two also.

    • WPBeginner Support says:

      If you only copied everything from FTP then you probably only have your WordPress files and not the database. Without the database backup you can not restore your site. If you have access to your host, then please create your database backup.

  23. Kyle says:

    Thanks for all your tutorials, I find myself here often. I had a question, is there any way to retrieve the subscribers from a backed up .sql file? The plugin used to collect subscriptions was Subscriber 2.

  24. Bruno says:

    Your site is great. Can you write a guide how to restore a backup created with BackWPup? That would be great.

    • WPBeginner Support says:

      Sure we will try to do that. Meanwhile, here is how to restore your backup created with BackWPUp plugin. Download your backup file and extract it. Inside it your will find a .sql file along with other files. .SQL file is your database backup and you can import it using phpMyAdmin. Upload rest of the files using FTP.

  25. tuyen ran says:

    how to show my password on file database backup from backupbuddy? It is encryption!. thanks you!

  26. Raji says:

    This post is extremely helpful as it has helped me (a newbie) to restore my site….or almost. When i try to login, it takes me to a page that says i should install wordpress again…. the famous 5minutes install. please help.

    • WPBeginner Support says:

      It seems WordPress is unable to connect to the database. Or it connected to the database which is currently empty. You have restored your WordPress files but you probably didn’t restore your WordPress database backup successfully.

  27. Md Jafrul Islam says:

    Thank you very very much. By this info post detail. I can make my site again restore. Thanks Man. Just awesome update more amazing info.

  28. Chris says:

    When doing a backup, which backup do I need most frequently? I am offered three choices on the cPanel (full cPanel backup, home directory, database). Would you say it is more important to backup the database file, as long as I have a fairly recent backup of the home directory?

    Thanks for your time!

    • WPBeginner Support says:

      Depends on how often your site gets updates like comments, posts, media uploads, we would say that you should always set a high priority for database backups

  29. Bas says:

    Thanks for the great guide(s). I had to move 2 sites from 1 server to a new server, and using your manuals it went like clockwork.

    Making the backup via BackWPup was quick and restoring it manually the same.

    I was up and running again in 15 minutes.

    BTW. The version of BackWPup I use (3.0.13) only showed the Dropbox feature after creating, saving and running the backup job.
    I had to change something, when the sites where moved, and there it was.

  30. Naik says:

    I recently shifted my blog from one hosting to another in Godaddy. I have the backup of my blog in .sql format. I am trying to import using MySQL, it shows an error “Script timeout passed, if you want to finish import, please resubmit same file and import will resume.” Please help

  31. Brenda says:

    I have been able to follow the instructions above for restoring my wordpress database using cpanel by dropping the tables in the current database and replacing them with the backedup database.

    However I can’t work out how to do it if I create a new database – the article says to go into mysql within cpanel and set up a new database, password etc but how do I link the new database to the files that I have reinstalled?

    Thank you

    • WPBeginner Support says:

      Brenda, connect to your website using an FTP client like filezilla, download wp-config.php file from your website’s root directory create a backup of it by simply making a copy of it. Open it in a text editor like notepad. and enter your database name, database user name, database password, and host (usually localhost). Save the file and upload it back to your website.

      • Brenda says:

        Thanks. I have done that but when I try to access the site I get “Error establishing a database connection”

        I did what you said and replaced the original wp-config file with the new version.

        What else do I need to do to be able to use the new version of the database, rather than the original one?

        • Brenda says:

          Sorry, some more information that might clarify what is happening. When I try, as suggested in your article, to access the wp-admin url I get an error message that starts with the following:

          We were able to connect to the database server (which means your username and password is okay) but not able to select the NAME database.

        • Brenda says:

          Sorry, some more information that might clarify what is happening. When I try, as suggested in your article, to access the wp-admin url I get an error message that starts with the following:

          We were able to connect to the database server (which means your username and password is okay) but not able to select the NAME database.

          At the bottom it says: On some systems the name of your database is prefixed with your username, so it would be like username_webgyzec_replacewp1. Could that be the problem?

          That is indeed the case. So what do I need to change please to get this to work?

        • Brenda says:

          OK I can stop sending messages now. Silly error on my part but now everything is working.

          Thank you SO much for such a helpful article.

  32. Henry says:

    Thanks for sharing.

  33. John says:

    Thanks so much.

  34. Abhisek says:

    Thanks for this very informative post. I was wondering how you could trim your breadcrumbs. I wish if you could help me with that for my blog TechniKaly.

  35. Jotpreet says:

    Nice read. Hope you’ll give a little bit more cody part in the post. But until then,
    Cheers !

  36. Mustafa says:

    i am new in yours’ website. Actually my first impression about your site is fantastic. Thanks for all of the tutorials. This tutorial is also great. Thanks again…

Add a Comment

We're glad you have chosen to leave a comment. Please keep in mind that all comments are moderated according to our comment policy, and all links are nofollow. Do NOT use keywords in the name field. Let's have a personal and meaningful conversation.