How to Restore a WordPress Site from a Backup (5 Ways)

At some point, you’ll need to restore a backup of your site. Maybe your WordPress website got hacked, or something went wrong during an update. Whatever the case might be, backing up your website regularly is the best way to ensure that you never lose any important data. 

Fortunately, there’s more than one way to back up and restore a WordPress website. Knowing how each method works will enable you to decide what option to use.

In this article, we’ll take a closer look at the reasons why you need to back up your WordPress site. Then we’ll talk about the different types of backups and help you decide which method works best for you. Let’s get to work!

Why you might need to restore a WordPress backup

Every website can benefit from having multiple recent backups that you’d be able to restore from. Those saved files are your safety net in case something goes wrong, which if you run a website, you know will happen sooner or later.

Here are some scenarios where you might need a backup:

  • Your website gets hacked. Instead of struggling to regain control of the WordPress admin, you can simply restore a backup.
  • A plugin/theme conflict crashes your site. You can spend hours troubleshooting plugin and theme conflicts or you can simply restore your website’s most recent backup.
  • Adding code to a WordPress file causes an error. In many cases, adding custom code to WordPress files can result in errors if the code itself is faulty. When that happens, restoring a recent backup is a guaranteed fix.
  • You’re not happy with a site update. Instead of trying to revert your website to its previous state by hand, you can restore the backup that you made before making those changes.

One common thread with backups is that they work best if they’re recent. If you only back up your site once a month, that copy might be useless if you’ve made a lot of changes since then.

Ideally, you should back up your website every time a change is made. That might seem like overkill, but it’s the best way to ensure you don’t lose anything on your site. If you’re concerned about storage, make sure you choose a backup tool that includes a lot of storage space (preferably at no extra cost!) or that can integrate with off-site storage solutions like Google Drive or Dropbox.

Overall, there are no downsides to backing up your WordPress website as often as possible. Before you get to work, though, it’s important to understand that there are multiple types of website backups. Let’s take a look at them. 

Different types of WordPress backups and restore options

Traditionally, a website backup is an entire copy of all of its contents. When you back up a WordPress website in full, you’re creating copies of the entire site and its files, as well as its database.

We say “in full” because that’s not the only type of backup that you can create. Modern tools provide you with a lot of control over what files you can copy and restore. 

The three most common types of website backups are:

  1. Full website backup. This type of backup creates a full copy of your site, including its database.
  2. Partial site backup. A partial backup creates a copy of specific sections within your website. With WordPress, you might back up your database but not the site files, or simply create copies of your existing plugins and themes, among other options.
  3. Incremental site backups. Some WordPress backup tools can detect changes to your site between one restore point and the previous one. That way, they can see what files and content are new or updated and simply back up those changes. 

Generally speaking, full website backups are always better than partial copies. They’re also the better option if your website breaks down or gets hacked. In those cases, restoring a full site backup means that you’re rolling back the clock to an earlier version of your website, including both its files and database. 

The downside of full site backups is that they take up more storage space. Moreover, it can take a while to create them if you’re running a site with a lot of content and files.

Partial backups are a great way to troubleshoot problems with plugins and themes. If you’re planning on switching themes or trying out new tools, you can back up your existing configuration and roll back if you run into any errors.

Finally, you have incremental, or real-time backups. Although they’re not available with all hosts or plugins, they give you the best of both worlds. They can be much faster and reduce the potential for timeouts due to server bloat.

How to restore WordPress from a backup (5 ways)

1. Restore a cPanel host backup

cPanel is the most popular hosting control panel among shared plans. The panel includes dozens of options and tools that enable you to do everything from installing WordPress to accessing a file manager and creating/restoring backups. 

If your web host offers you a cPanel account, go ahead and log in. You should see a broad collection of tools divided into categories. Look around for a section that says Files, which should include a Backup Manager option:

cpanel options, including Backup Manager

Once you open the Backup Manager, you’ll get access to one or more backup tools, depending on what cPanel setup you’re using. In most cases, there should be backup creation and restoring options, as well as a wizard if you need a bit of extra help:

cPanel backup options

If you click on the cPanel Backups tool, you’ll see the option to download a full site backup. cPanel will store those files for a few days, depending on how your web host configured their setup. 

You can use those saved copies to restore backups from this same window, by selecting the file from your computer and uploading it. cPanel also provides you with the option to restore database backup files and email server configurations: 

choose between full backups, account backups, and partial backups

If any of the above sounds confusing, we recommend using cPanel’s Backup Wizard tool. This will walk you through creating or restoring full or partial backups of your website while explaining every part of the process:

the Backup Wizard tool with options to back up or restore

It’s important to note that not every cPanel setup will look the same or contain the same tools. Each web host can configure their cPanel to limit what functionality users have access to. 

In some cases, your web host might choose to disable the option to create manual backups due to limited server resources (this is more common with shared plans). If that’s the case, you might need to opt for a manual website restoration approach instead.

2. Use a backup plugin like Jetpack Backup

There is a massive range of WordPress backup plugins that you can use. These tools help you create safe copies of your website, including all of its files and the database.

However, Jetpack Backup is the best WordPress backup plugin. It offers real-time backups, so you know that every single sale, blog post, comment, and change is completely saved. Plus, they’re incremental, so you don’t have to worry about storage space. The best part? You can easily back up and restore your site in just a few clicks, even if your WordPress dashboard is completely inaccessible — no code or server management required!

After installing and activating Jetpack Backup, you’ll need to connect it to a account to access its features:

creating a account

Once you connect your website with Jetpack, you’ll see an overview of the backups you’ve created so far, as well as the options to download or restore any of them:

the latest backup of a site from Jetpack Backup

You’ll also have access to the activity log, which keeps track of all changes you make on your site. So if you want to roll back to before something went wrong — like a hack or plugin update — you can simply select a backup from before that event. Super simple!

3. Use cPanel to manually backup and restore WordPress

As we mentioned before, cPanel gives you access to a file manager tool. This enables you to access your server’s file directory and most importantly, your WordPress root folder. The root folder contains all of your site’s files, including media documents, plugins, themes, and configurations.

To access the file manager, log into your cPanel account and go to FilesFile Manager. Once you select that option, you’ll see an overview of your server’s directories. Look for the folder called public_html, www, or your site’s name:

public_html folder inside of the File Manager

That is your WordPress website’s root folder. Feel free to open it and browse its contents, but don’t edit or delete any files unless you’re sure what they do. To back up that folder, select it and click on the Download option on the file manager’s top menu:

public_html folder highlighted

The root folder will download as a zipped file, which you can store anywhere you want until you’re ready to restore it. If you need to do so, return to the file manager and open the same directory where the root folder is located (the one you see above).

Before we go through with the backup, it’s worth noting you can also download individual folders instead of the entire root directory. In some cases, you might only want to back up plugins, themes, and/or media files. You can find all of those components within the public_html/wp-content directory:

several folders highlighted inside of public_html

Theme, plugins, and uploaded files each have their own directory, which you can see in the screenshot above. To back up any of those components individually (or together) simply download those folders and store them as you would with a regular backup.

To restore the backup you created, delete the root folder on your server and select the Upload option on the top menu of the screen. Unzip and upload the directory you saved to your computer and wait for the process to finish. Since you’re uploading hundreds of files, it may take a while.

Alternatively, if you only backed up one or more folders, you can simply replace those within the WordPress root directory. Doing so won’t affect the rest of your site’s configuration or content — it will simply return plugins, themes, and/or media files to a previous state.

Keep in mind that downloading the WordPress root folder is only half of the process. You’ll also need to download a copy of your database for a full backup. To do so, return to the main cPanel screen and go to Databases → phpMyAdmin:

phpMyAdmin shown in cpanel

phpMyAdmin is a database management tool that you can use to access and edit tables. Once you open it, you’ll see a menu including one or more databases, depending on how many sites you have.

Access the database that you want to back up using the menu to the left, by selecting the option with your database name. You’ll see an overview of the database’s tables, as well as a menu at the top of the screen that includes an option that reads Export:

tables listed inside of a database

Click on Export and select the Quick option on the next screen. Set the Format: to SQL and click on Go:

export methods: quick and custom

This will download a copy of the database to your computer in .sql format. If you need to restore that copy of the database, you can do so through phpMyAdmin as well. Simply go to the Import tab, select the database file to upload, and click on Go:

file import option for the database

If you restore only the database or your root folder manually, your website won’t return to its previous state. For a successful backup restore, you need both components. That makes this manual approach very time-intensive. Moreover, it requires you to store all the backup files in a safe location and organize them so that you don’t mix them up.

4. Use FTP to manually backup and restore WordPress

This method works similarly to the last one in that you download your site’s files manually. The main difference is that instead of doing it through your cPanel, you’ll be using a File Transfer Protocol (FTP) client. 

The advantage of using FTP is that it’s optimized to help you download large numbers of files. Moreover, it’s less prone to errors than using the cPanel file manager.

To get started, you’ll need an FTP client and the credentials to connect to your WordPress website. Note that these FTP account credentials aren’t the same ones that you use to log into WordPress or to your hosting control panel. 

In most cases, your web host will set up a unique set of FTP credentials for you when you sign up. If you don’t know what they are, you can look them up on your hosting control panel:

SFTP credentials

Once you have your FTP credentials, you can use them to log into your server through a client like FileZilla. When you connect to the server, you’ll see all the directories that you have access to. The WordPress root folder should be among them:

list of website files in an FTP program

Right-click on the root directory and select the Download option. That will download the entire folder and its contents to your computer, where you can store it anywhere you want until you need it.

To restore that backup, you’ll need to access your server via FTP, locate the root folder, and delete it. Then, re-upload the version you downloaded previously and you’re good to go. Keep in mind that both uploading and downloading the entire root directory will take a while as we’re talking about hundreds of files. But this could be a great option to restore and replace individual files (like a plugin or theme) without having to delete the entire root folder.

Just like with the last method, you’ll need to export your WordPress database separately. You can read about how to do that using phpMyAdmin in the previous section, where we also covered how to restore the database file.

5. Use a WordPress staging site (if you have one)

Some web hosts offer a feature called “staging”. This means that they enable you to make a copy of your website that’s not available to the public. You can use staging sites for development purposes, like testing new features, before pushing those changes to “production” or a live environment.

Staging websites can double as backups of sorts. You can use them to make any changes that you would have made on the live site and if they don’t work out, you can delete the staging site without any issues whatsoever.

Whether or not you have access to staging functionality depends on what web hosting service you use. Generally speaking, most shared hosting plans don’t offer staging features, but if you use managed WordPress hosting, chances are you have access to staging functionality:

staging environment option to push changes live

As a rule of thumb, we recommend using staging tools to test any significant changes to your website. This can help you ensure that your site never breaks due to unforeseen circumstances while updating it. Any web developer worth their salt will tell you the same thing — you should be using a staging website.

Explore the benefits of Jetpack

Learn how Jetpack can help you protect, speed up, and grow your WordPress site. Get up to 50% off your first year.

Explore plans

How to restore a WordPress site without a backup

There’s literally no reason not to back up your website often. However, if you end up in a situation where you haven’t set up a backup solution and you need to restore part of your website, there are some ways to recover lost content, all thanks to the magic of the internet.

You may have noticed that when you Google a website, sometimes you’ll see the option to access a cached version of that page. To access that cached copy, click on the three dots next to any entry in Google search results and a window with information about the website will pop up. If you look at the bottom of that window, you’ll see a button that says Cached:

Google search with a Cached option

Clicking on that button will open a cached version of the website in question. At the top of the screen you’ll see information about when that copy was made:

cached date and time of the WordPress website

Keep in mind that you won’t be able to navigate the entirety of the cached copy as you would a regular website. If you want to find a specific page that you want to restore, you’ll need to Google it and cross your fingers that the search engine stored a recent copy of it.

To help find a cached version, you can type “cache:” before the page’s URL on Google searches (“cache:”). You can also search for specific pages of your site by looking up the URL directly by adding “site:” before the search (example “site:”).

If you find a cached copy of the page that you need, you can try to recreate it using the WordPress editor. That means copying all of the text and downloading and re-uploading images to make sure the new copy is as faithful to the original as possible.

It’s important to note that Google might not have a copy of the page(s) that you’re trying to restore. In that case, your next best bet is to use the Internet Archive’s Wayback Machine. This is a website dedicated to storing copies of other sites, so it might just have one of yours:

the WayBack Machine homepage

To use the Wayback Machine, enter your site’s URL and it’ll return a timeline that includes any copies of your site on its servers. You can select which copy to access using the calendar below the timeline:

dates available on the WayBack Machine

Select a date and you’ll access that copy of your site. Unlike Google, the Wayback Machine will enable you to navigate throughout the entire copy of your site as usual. That way, you’ll be able to restore as many pages as you need.

Keep in mind that the Wayback Machine might not have copies of your site depending on its popularity. If it doesn’t, then the best thing that you can do is to set up a WordPress backup solution right away so you’ll never lose content again in the future.

What to do after you restore a WordPress backup

If you ever need to restore a WordPress backup, the work isn’t done after your website is returned to normal. Depending on the reason why you restored that backup, you might also need to further secure your WordPress website.

After a hack, it can be hard to pinpoint how attackers managed to get in. However, in most cases, the cause boils down to one of the following reasons:

  1. Easy-to-crack administrative credentials. If your admin account is called admin, then you need to change that right away. On that same note, you need to use secure and unique passwords for your account, and they need to change periodically.
  2. Poor database security. By default, a lot of WordPress web hosts use the same prefix for your website’s database. That means attackers might be able to identify and attack it using SQL injections. You can prevent this by changing the database prefix and name.
  3. An outdated version of WordPress. If you’re using an outdated version of WordPress, go ahead and update it after you restore the backup. Ideally, do so using a staging environment to make sure the update doesn’t break your site.
  4. Outdated plugins and/or themes. Using outdated plugins and themes is one of the main ways that WordPress websites get hacked. The older the code is, the more likely that attackers will find security flaws.

Your main priority after restoring a backup is to ensure that you patch any security holes that enabled attackers to gain access to your site. If they did it once, chances are they might be able to do so again unless you’re more proactive when it comes to hardening your WordPress security.

Additionally, you’ll want to check that no new content is missing from your website and that all its core functionality remains intact. If you create regular backups, you shouldn’t be missing any content. If you are, you might need to recreate that content from scratch or use the Google Cache method we discussed earlier.

How to avoid needing a WordPress backup

We’d never tell you not to back up your website often, but the best type of backup is the one that you never need to use. That is to say, if you can avoid running into errors while updating your site and improve its security, you might never need to restore a WordPress backup. 

With that in mind, let’s talk about several best practices that you can follow to keep your website in top shape.

1. Update WordPress regularly

WordPress websites sometimes “break” because of outdated versions of the Content Management System (CMS), plugins, or themes. The older the software is, the more likely you are to run into errors. That applies universally, not just with WordPress. 

Ideally, you should check the WordPress dashboard often to see if there are any updates available for your website. Simply navigate to the Dashboard → Updates tab and take a quick look:

available updates in WordPress

If you want to play it extra-safe, we recommend running updates using a staging version of your website. That way, you can check if anything breaks after updating WordPress, which can sometimes happen with major WordPress releases or if you’re updating a lot of plugins at once.

Some tools, like Jetpack, also enable you to turn on automatic updates for plugins and themes. Therefore, you won’t have to check manually for new updates. This can ensure that you’re always using the latest versions of the tools that your site relies on

2. Increase your website’s security

One of the primary reasons why backups are so useful is that they help you regain control of your site in the event that it gets hacked. If someone manages to take over your account, they can lock you out of the WordPress admin and you’ll be left with little recourse except to contact your hosting provider.

If you have recent backups, you can simply restore your website to a point before the attack. Since you’re also restoring the database, your account will revert to its previous credentials, which you can then update later.

If you’re using Jetpack, you can restore backups even if you lose access to your website. The plugin even enables you to restore backups from your mobile device. You can also use Jetpack to enable Two-Factor Authentication (2FA) and brute force attack prevention.

3. Use a staging site to make major changes to WordPress

Using a staging website will drastically reduce the chances of needing a WordPress backup. 

Ideally, you should use a staging website whenever you have to:

  • Update WordPress versions. Major WordPress updates may not play nicely with your plugins and themes, so it’s a good idea to take them for a spin on a staging site. It’s also important to know how to roll back your WordPress version if needed.
  • Update multiple plugins and themes. If you’re updating several tools at once, it’s in your best interest to do so on a staging site to mitigate risk.
  • Make major changes to your site’s style or configuration. If you’re planning any significant content or style changes to your site, use a staging environment. That way, if you’re not happy with the results, you won’t have to revert the changes manually.

If your web host doesn’t offer staging functionality, you may want to consider switching to a different provider. 

The best way to backup and restore your WordPress site

In most cases, we recommend using a WordPress plugin that gives you full control over how to back up your website. Jetpack Backup does precisely that. Depending on which plan you sign up for, the plugin can offer real-time and automated backups.

With Jetpack, your site backups are stored on servers, which is one of the safest places they can be. You can also restore backups directly from the mobile app, which is ideal if you get locked out of your site. 

We believe that Jetpack Backup is the best WordPress backup solution because it protects each and every change you make, secures backup files off-site, and makes it easy to restore, even if your site is completely down. 

Protect your site with Jetpack Backup

This entry was posted in Security. Bookmark the permalink.

Rob Pugh profile
Rob Pugh

Rob is the Marketing Lead for Jetpack. He has worked in marketing and product development for more than 15 years, primarily at Automattic, Mailchimp, and UPS. Since studying marketing at Penn State and Johns Hopkins University, he’s focused on delivering products that delight people and solve real problems.

Explore the benefits of Jetpack

Learn how Jetpack can help you protect, speed up, and grow your WordPress site. Get up to 50% off your first year.

Explore plans

Have a question?

Comments are closed for this article, but we're still here to help! Visit the support forum and we'll be happy to answer any questions.

View support forum
  • Enter your email address to follow this blog and receive news and updates from Jetpack!

    Join 112.6K other subscribers
  • Browse by Topic

  • %d