Categories: Blog

Fix “There Has Been a Critical Error” After Migration

So, you just migrated your WordPress site and… BOOM! A mysterious message shows up on your screen.

“There has been a critical error on this website.”

Yeah, we know. Not your idea of a warm welcome. But don’t worry — we’re here to explain it in the simplest, most fun way possible. 😄

What Does That Even Mean?

This error is WordPress’s way of saying, “Something is broken, and I don’t want to show anything until it’s fixed.”

It doesn’t tell you much. That’s what makes it annoying. But the good news is — you can fix it!

Why Does This Happen After a Migration?

When you move your site from one place to another (like a new host or different domain), a lot of things can go wrong. Here are some common causes:

  • PHP version mismatch
  • Theme or plugin conflicts
  • Broken database connection
  • Missing or corrupted files
  • Wrong site URL settings

Let’s walk step by step through some fixes. You don’t need to be a tech wizard. Just follow along!

Step 1: Enable Debug Mode

Before you do anything else, let’s find out what exactly is causing the problem.

Open your wp-config.php file. This file is in the root folder of your WordPress installation.

Look for this line:

define( 'WP_DEBUG', false );

Change it to:

define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );

This tells WordPress to log all errors but not display them. The log file will be saved in

/wp-content/debug.log

Check that file after accessing your site again. It’ll tell you what’s breaking things.

Step 2: Switch to a Default Theme

Your site might be using a custom theme that doesn’t like its new home.

If you can, log into your WordPress Dashboard and go to:

  • Appearance > Themes
  • Activate a default theme like Twenty Twenty-One or Twenty Twenty-Three

But if you can’t access the dashboard, change the theme through the database.

  1. Log into your hosting control panel
  2. Go to phpMyAdmin
  3. Find your site’s database
  4. Locate the wp_options table
  5. Change the values of template and stylesheet to twentytwentyone or another default theme

Step 3: Deactivate All Plugins

Plugins are great. But they can be drama queens during a migration.

You can do this one of two ways:

Option A: Rename the Plugins Folder

  1. Use FTP or your file manager in hosting
  2. Go to wp-content folder
  3. Rename the plugins folder to plugins_old

This deactivates all plugins instantly.

Option B: Use phpMyAdmin

  1. Go to your wp_options table
  2. Search for the active_plugins row
  3. Clear the value so plugins won’t load

Then try loading your site again. If it works, you’ll need to re-enable plugins one by one to see which one caused the mess.

Step 4: Check Your Site URL

If your site URL settings are wrong, WordPress gets confused.

To fix them:

  1. Go back into phpMyAdmin
  2. Edit the siteurl and home values inside the wp_options table
  3. Make sure they match your new domain (e.g., https://newsite.com)

Still not working? You can also override these in wp-config.php like this:

define( 'WP_HOME', 'https://yourdomain.com' );
define( 'WP_SITEURL', 'https://yourdomain.com' );

Step 5: Repair the Database

Your database may have gotten a few bumps during the move.

To repair it:

  1. Edit wp-config.php
  2. Add this line before /* That's all, stop editing! */:
define( 'WP_ALLOW_REPAIR', true );

Then visit this URL in your browser:

https://yoursite.com/wp-admin/maint/repair.php

Follow the instructions to repair and optimize your database.

Don’t forget to remove that line from wp-config.php afterward!

Step 6: Make Sure the PHP Version Is Right

WordPress needs the right version of PHP to run smoothly. Too old or too new, and it throws a tantrum.

Check your current version using your hosting control panel. WordPress recommends:

  • PHP 8.0 or 8.1

If you’re running something older (like 7.2), upgrade it. If you went too futuristic with PHP 8.2 and things broke, try downgrading to 8.0 or 8.1.

You can usually change the PHP version through your host’s control panel, often under something like “Select PHP Version.”

Step 7: Missing Files? Re-upload Core WordPress Files

Sometimes files don’t transfer well during a migration. And WordPress gets cranky when it can’t find what it needs.

You can manually reupload the core files:

  1. Download the latest WordPress ZIP from wordpress.org
  2. Unzip it on your computer
  3. Use FTP to upload everything except the wp-content folder
  4. Also do not overwrite wp-config.php

This will replace any corrupted files without touching your content or settings.

Bonus Tips

Here are some extra things to consider just in case:

  • Check file permissions: Make sure folders are 755 and files are 644
  • Clear your browser cache
  • Check your .htaccess file: You can reset it by going to Settings > Permalinks in the Dashboard and saving
  • Enable recovery mode: WordPress sometimes sends a link to your admin email address that lets you fix problems in recovery mode

When All Else Fails…

Still getting that critical error after trying everything? It might be time to call in the big guns. 💪

Contact your host’s support team. They can check server logs, database settings, and other stuff that’s above your pay grade.

You can also try a WordPress-specific support forum like:

Final Thoughts

The “critical error” sounds scary… but it’s usually fixable. The key is to go step by step, stay calm, and maybe even smile a little along the way 😊

Remember: every WordPress expert once broke their site and saw this same

Lucas Anderson

I'm Lucas Anderson, an IT consultant and blogger. Specializing in digital transformation and enterprise tech solutions, I write to help businesses leverage technology effectively.