Emergency Guide: How to Restore WordPress Using Only a Database Backup (2026)

Site crashed and only have a database backup? Don’t panic. Follow this 2026 guide to restore your WordPress content, fix permalinks, and recover missing images.

Imagine this scenario: Your website has crashed. Maybe it was a hacker attack, a server failure, or an accidental deletion. You scramble to find a backup, only to realize you don’t have a full backup—you only have the MySQL database file (.sql).

Is your site gone forever? No.

In this WordPress Emergency tutorial, we will show you how to resurrect a WordPress site using only a database backup. While this method is a “partial restore” (meaning you may lose some images), it will recover your posts, pages, comments, and settings.

What You Will Need

Before starting this recovery process, ensure you have:
  1. Access to your Hosting Control Panel: (cPanel, Plesk, or Managed WP Host).
  2. The Database Backup: Usually a file ending in .sql or .sql.zip.
  3. FTP/File Manager Access: To upload fresh files. 

Step 1: Prepare the Database

Since your site is down, we need to create a clean environment to import your old data.
  1. Create a New Database: Log in to your hosting panel and find the “MySQL Databases” section. Create a new, empty database and a new user. Write down the Database Name, Username, and Password. You will need these later.
  2. Open phpMyAdmin: Locate phpMyAdmin in your hosting panel. 
  3. Import Your Backup: 
  • Select your newly created database on the left sidebar.
  • Click the Import tab. 
  • Click Choose File and select your old .sql backup file. 
  • Click Go/Run.

Critical Check: Once imported, look at the table names on the left (e.g.,wp_posts , wp_options). Note the prefix (usually wp_ , but it might be wp56_ or similar). You must know this prefix for Step 2.

Step 2: The "Fresh Install" Trick

Since you only have the database, you are missing the core WordPress files. We need to install a fresh copy of WordPress and “trick” it into using your old data.
  1. Download WordPress: Get the latest version from WordPress.org.
  2. Upload the Files: Upload the unzipped WordPress files to your server (public_html folder) via FTP. 
  3. Run the Installation: Visit your website URL. You will see the language selection screen. 
  4. Connect the Database: When asked for database details, enter the New Database Name, User, and Password you created in Step 1. 
  5. The Prefix Secret: The installer will ask for a “Table Prefix.” Enter the exact prefix you noted in Step 1 (e.g., wp_ ).

The Result: WordPress will see that the tables already exist. Instead of installing a blank site, it will say “Already Installed” and let you log in using your old username and password.

Step 3: Reinstall Themes and Plugins

Your text content is back, but the site will look broken. Why? Because the database says “Use Theme X,” but the files for “Theme X” are missing.

  1. Reinstall Your Theme: Go to Appearance > Themes. Install and activate the exact theme you were using before the crash.
  2. Reinstall Plugins: Go to the Plugins menu. You will see a list of errors saying “The plugin X has been deactivated due to an error: Plugin file does not exist.” This is actually helpful—it acts as a shopping list! Go to “Add New” and reinstall every plugin on that list. 

Step 4: Fix the "404 Not Found" Errors

After a manual restore, your links (URLs) often break, leading to 404 errors when you click on posts.

The Fix:

1. The Header(header.php)
  1. Go to Settings > Permalinks.
  2. Scroll down and click Save Changes. 
  3. Do not change anything—just clicking save flushes the rewrite rules and fixes your links. 

Step 5: The Missing Images (The Hardest Part)

This is the reality of a database-only restore: Your database knows where the images should be, but the actual image files (JPG/PNG) are gone. You will see “broken image” icons on your pages.

How to Recover Lost Images:

  1. Identify Broken Images: Install a plugin like Broken Link Checker. Run a scan to see exactly which image files are missing.
  2. The “Time Travel” Trick: If you don’t have the images on your computer, use the Wayback Machine (Archive.org). 
  • Go to Archive.org and enter your website URL.
  • Click on a date from before your site crashed.
  • Navigate to your pages, right-click the images, and save them.
  • Re-upload them to your WordPress Media Library. 

Conclusion: Never Do This Again

Restoring a site this way is stressful, time-consuming, and imperfect. In 2026, website security is not about luck; it’s about preparation. You shouldn’t have to piece your business back together like a puzzle.

Avoid the stress next time:

  • Need immediate help? If your restore failed, contact us for WordPress Emergency assistance.
  • Want guaranteed safety? Sign up for our Support and Maintenance plans. We perform daily, full-site backups (files + database) stored on secure cloud servers. If your site breaks, we restore it to perfection in one click. 

Need WordPress help right now?

Emergency fixes start at $59 with same-day turnaround. Monthly care plans start at $99.