If your WordPress website has been hacked, or just isn’t working properly anymore, you may need to restore the site to a previous version. In this post, we’ll cover the basics of restoring WordPress and the various steps you’ll need to take to get your WordPress website up and running again.
Restoring WordPress Requires a Backup
Restoring a WordPress site implies that you have a backup of your website. Without a backup, unfortunately, there is nothing to restore.
A proper WordPress backup should include all the elements that make up your site. A backup is essential, not just for voluntarily restoring your site (for example, if you’re moving hosts), but if disaster strikes, and you find your site compromised, running into database issues, or worse.
What are the Building Blocks of a WordPress Site?
Dissecting a WordPress site will give us the following components that are essential to any WordPress site and necessary for successfully restoring WordPress:
- WordPress – The core software that runs your website. The WordPress core software contains all the code and functions that run a WordPress site (such as the WordPress admin dashboard from which you manage your content, site settings and more).
- A database – WordPress stores all content and data, such as posts, pages, categories, comments, users, options and settings in a database.
- A theme – WordPress comes shipped with a default theme, but most, if not all users will use a WordPress theme of their own choice, perhaps even their own design.
- Plugins – WordPress plugins extend the functionality of your website, for instance, by adding a shopping cart, a contact form, and much more.
Requirements and Tools Needed to Restore Your WordPress Website
Restoring a WordPress site means that you should have access to:
- A healthy copy of the items listed above (WordPress, database, theme and plugins). In particular for your content, it is vital to always have a fresh backup of the database. You don’t want to restore your site and end up with the most recent content being a post from 2014.
- Your Server. Server access is usually provided through an FTP account. Your hosting provider will have the access credentials and information you need to access your server, enabling you to copy files to and from that server. Alternatively, your hosting account’s control panel provides “file manager” functionality enabling you to copy files.
- The Database. You will most likely use a program called phpMyAdmin, and again, access information should be provided by your hosting provider.
What is FTP?
FTP is an acronym for File Transfer Protocol. Through an FTP client, you can connect to an FTP server. Your hosting account usually comes with an FTP account, or you can create one using your hosting provider’s control panel.
During the setup of your hosting account, all the relevant information needed to set up your FTP access should be communicated to you by your host. You typically connect to your server using a username and password, and an FTP address on the host server. In almost all hosting accounts, your FTP server will have an address based on your domain name, for example if your domain is “mysite.com” the FTP server can be accessed through “ftp.mysite.com.”
Once signed into your FTP server, you can easily transfer files from and to your server. Popular FTP clients are FileZilla (free and open source, available on all platforms), WinSCP (Windows only, free and open source) and Transmit (Mac OS X).
What is phpMyAdmin?
WordPress stores its data in a database, and phpMyAdmin provides access to MySQL databases. Be aware that through phpMyAdmin you can seriously damage your databases, but with proper care, it is a useful tool to backup a database (through the “export” function), and restore a database (using “import”). phpMyAdmin can (generally speaking) be accessed through your hosting control panel. Exported databases are saved in a file with a .sql extension.
Restoring the WordPress Core Software on Your Site
It’s happened to me a couple of times, for some reason, a WordPress function isn’t working anymore, or an error pops up related to core WordPress functions.
The first thing to try is to refresh your WordPress install. The easiest way to do this is by updating WordPress through your WordPress dashboard. However, if you’re really out of luck and don’t have access to your WordPress dashboard, you need to use FTP to access the WordPress files.
If you are unsure about any of these steps, you might want to consider asking a professional for assistance. Where possible, make copies of folders and files before you continue. Read the instructions to the end first before starting.
Here are the steps to restore the WordPress core software:
- 1. Download the latest version of WordPress core software. You can download WordPress here.
- 2. Locate the zip file you just downloaded, and unzip the files.
- 3. Connect to your server using an FTP client.
- 4. Transfer all files from the downloaded and unzipped WordPress version EXCEPT the
wp-contentfolder to your server.
- 5. When done, your WordPress install is refreshed and using the latest version of WordPress.
wp-includesfolder from the server.
Just DO NOT delete the
wp-contentfolder! Also delete all WordPress files in the root of the site EXCEPT the wp-config.php file(!). This will make sure that there can be no residue of any potentially corrupted or outdated WordPress files.
Now check your site; it should be running fine. If there still is an issue, you may need to restore the entire site.
Restoring an Entire WordPress Site
Restoring an entire WordPress site, including themes, plugins, database requires some additional steps. You should have access to copies of your WordPress site, and the database.
Restore WordPress, Your Themes and Plugins
Provided that you have a backup of your WordPress site (including WordPress core software, database, themes and plugin files), you connect to your FTP server. Copy all the WordPress and theme files from the location where you saved them using FTP.
- 1. Connect to your server using an FTP client.
- 2. Transfer all files from the location where you saved them to your server. If you have a backup of your site in a zip file, first unzip all files.
- 3. Proceed to restore your database.
Restoring Your Database
To restore the database of your WordPress site, you need to have access to a backup of the sql database. When creating a backup, you export the existing database using phpMyAdmin, a tool available from your hosting cPanel.
- 1. Start phpMyAdmin, and you will see a list of all databases. It is advised to delete all tables first. Tables are the files in which WordPress saves all the information for your site, including posts, pages, comments, (theme and plugin) settings, etc.
- 2. First remove all existing tables from that database. Open the database you want to replace, make absolutely sure you select the right one.
- 3. Tick the “Check All” box.
- 4. From the “With selected”, select “Drop.”
- 5. Click “Yes” on the confirmation popup “Do you really want to execute the following query?”
- 6. Once all tables are dropped (deleted), you can start importing your backup database.
- 7. Make sure that you have the proper database selected, and click the “Import” tab.
- 8. Select your database backup from your computer.
- 9. Leave all options set to the defaults and click the “go” button.
- 10. Wait for the confirmation.
Congratulations, you have now successfully restored your WordPress database.
Your ability to successfully restore your WordPress site depends on a couple of factors.
- You need to make regular backups of both your WordPress files, themes and plugins as well as your database.
- You need to store these in a secure location, preferably on 2 different locations (e.g. on your computer and using a cloud storage provider such as Google Drive, Dropbox, iCloud etc.).
- You also need to have FTP access and access to phpMyAdmin, both are usually provided by your hosting provider, as well as a certain level of proficiency in using these applications. As these applications have the potential to delete and break things, proper care must be taken when using these.
Restoring WordPress Using BackupBuddy
BackupBuddy is a comprehensive WordPress backup plugin that allows you to perform automatic WordPress backups at times that are convenient for you. BackupBuddy also combines WordPress backup and restore capabilities in one single plugin.
BackupBuddy takes the hassle out of doing (complex and often error-prone) manual backups and restore operations, and can:
- Create regular backups (database only, files only, or both) on a schedule you decide (hourly, twice daily, daily, every other day, bi-weekly, weekly, monthly and more)
- Send the backup file to a remote WordPress backup storage location (such as an e-mail address, Google Drive, Dropbox, BackupBuddy Stash, Amazon S3, etc.)
- Restore an entire WordPress site, or restore just a single file.
- Take care of properly updating the WordPress settings and database if you want to move your site to another domain.
- Monitor any changes on your site, and take snapshots of your site and its content “live” so that you will always have an up to date backup
To restore a BackupBuddy backup, all that is needed is access to the server to upload the backup zip file and BackupBuddy’s ImportBuddy tool.
After uploading both files, navigate to your site URL/importbuddy.php. For example, you’d visit this link in your browser.
Then it is just a matter of starting the import process, and the ImportBuddy tool will finish up restoring your WordPress site for you.
Learn More About BackupBuddy
BackupBuddy is a 3-in-1 WordPress backup plugin that allows you to backup, restore or move your WordPress site.