Every common post-migration error (404s, the 500 error, database connection failures, redirect loops, missing images) with the real cause and the exact fix for each.
I have cleaned up after a lot of migrations, from one-page small-business sites up to large networks of legacy blogs consolidating onto a single enterprise WordPress platform. After enough of them you stop being surprised. The errors that follow a move are remarkably predictable, and almost all of them trace back to three root causes worth memorizing. The database points at the wrong URL. The connection details in wp-config.php are wrong. Or the server’s rewrite rules and file paths did not move cleanly. Work out which of those three is true and most errors on this page resolve in minutes. The genuinely ugly ones that survive all three checks almost always turn out to be a redirect or taxonomy problem in disguise, and I will flag those as we go.
Think of this as a troubleshooting hub. Each section below tackles one error. You get the 404 error, error 500, the error establishing a database connection, too many redirects, a generic page not found, images not showing after migration, and All-in-One WP Migration not working. For each, I give you the symptom, what actually causes it, and the exact fix. Everything is mirrored in the FAQ at the end so you can scan for your symptom and jump straight to it.
wp-config.php, the database, or .htaccess. With a current backup, every fix is reversible. Still planning the move? Run a free pre-migration audit first so you know your baseline.If you would rather not touch live files, a managed WordPress Migration service handles the move and the cleanup so these errors never reach your visitors.
Five minutes of diagnosis saves an hour of guessing. Run through these checks before you edit a single file.
Add the following to wp-config.php, above the line that says “That’s all, stop editing”. It writes errors to wp-content/debug.log instead of dumping them on screen, or alongside the screen if you prefer.
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );Your host’s error_log (in the site root, or in the hosting dashboard) usually names the exact PHP file and line that failed. For a 500 error, this is the single most useful file you can read. Read it first.
Did the domain change, the server or host change, or both? That one question narrows everything. A domain change points you at URL fixes such as redirects, images, and links. A host change points you at wp-config.php credentials. If you are mid-move, the moving WordPress to a new host guide and the manual migration without a plugin guide walk the full process so you can spot the step you skipped.
Flush your permalinks first. Go to Settings → Permalinks and click Save Changes without altering anything. That forces WordPress to regenerate its rewrite rules and rebuild .htaccess. Stale rewrite rules are far and away the most common reason posts and pages return 404 right after a move, so start there before you touch anything else.
Move to a new server or domain and the rewrite rules often do not come along for the ride. WordPress still knows every page exists. The web server, though, no longer knows how to route a pretty URL like /about/ to it, so back comes a 404. As WPBeginner puts it, this is a rewrite-rule problem, not missing content. Your posts are fine. The routing is not.
https:// and no trailing slash)..htaccess file may be missing or stale. Via FTP, rename it to .htaccess_old, then save permalinks again so WordPress writes a fresh one.755 and save permalinks once more, as Cloudways notes.A flush fixes the common case. What it cannot fix is a URL structure that genuinely changed in the move. Take a migration where a network of legacy blogs lands on one enterprise WordPress platform: every publication ran on different legacy software, so the content comes in shaped differently from each one. An import that runs clean for one title can choke on the next, and at first the failures make no sense. You can chase a broken import for an hour before realizing the source data simply did not match the assumptions that worked on the previous title. Fold that many inconsistent source structures into one new URL scheme and a chunk of your old URLs no longer exist at the same path, full stop. No amount of flushing brings them back. That is a redirect job wearing a 404 costume. If your 404s survive a flush and the paths really did change, build a redirect map. The redirect section below and the migration guide cover how.
Nginx ignores .htaccess entirely. So if your new host runs Nginx, your host has to add the WordPress rewrite block to the server config. Flushing permalinks on its own will not touch an Nginx 404.
Nine times out of ten, a 500 after migration is one of three things. A corrupt .htaccess file, an exhausted PHP memory limit, or a plugin or theme conflict, and usually in that order. That ranking holds up in practice and lines up with both WPBeginner and WP Rocket.
A 500 is the server’s way of saying it tried to run your site and something stopped it cold. Vague by design. After a migration the usual suspects are a .htaccess directive the new server does not support, a PHP version mismatch, or a memory ceiling that sits lower on the new host than it did on the old one.
.htaccess. Via FTP, rename it to .htaccess_old and reload the site. If it loads, regenerate a clean file via Settings → Permalinks → Save Changes.define( 'WP_MEMORY_LIMIT', '256M' ); to wp-config.php, or increase it in your host’s PHP settings.wp-content/plugins to plugins_old via FTP. If the site recovers, rename it back and re-enable plugins one at a time to find the offender.error_log names the failing file, which is the fastest route to the real cause.Here is the habit that saves me the most time. Read the error log before you start pulling plugins one by one. More often than not it names the exact plugin or PHP function that tripped the 500. That alone turns a twenty-minute hunt into a two-minute fix.
WordPress cannot reach the database. Nearly every time, that is because the four credentials in wp-config.php (DB_NAME, DB_USER, DB_PASSWORD, DB_HOST) no longer match the database on the new host. This is the single most common error after a host change. I have lost count of how many times it came down to one wrong value.
Per Kinsta, the message shows up when the username and password in wp-config.php are wrong, or when WordPress simply cannot contact the database server at the host you named. After a migration the database name, user, and password are usually brand new. And DB_HOST is the value people miss most often.
wp-config.php and compare all four values to the database details on the new host (database name, the user assigned to it, that user’s password, and the host).DB_HOST correctly. Kinsta notes it is localhost roughly 90% of the time, but some hosts use 127.0.0.1 or a dedicated database hostname. Check your host’s documentation.All four values right and still no joy? Then the database may be corrupted, or the server is overloaded. Add define( 'WP_ALLOW_REPAIR', true ); to wp-config.php, visit your-site.com/wp-admin/maint/repair.php to run the built-in repair, then strip the line back out. If the database server itself is down, that one is on your host. Call them.
A redirect loop after a move is almost always one of two things. Either the stored Site URL and WordPress URL disagree, or a forced-HTTPS rule is fighting your stored http:// URLs. The browser bounces between two addresses until it throws up its hands.
Per WPBeginner, mismatched WordPress Address and Site Address values cause more redirect loops than anything else. It happens constantly. A domain change, an HTTP-to-HTTPS switch, a botched search-and-replace, any of them can do it. A CDN or SSL setting that forces HTTPS while the database still holds http:// URLs produces the exact same loop.
wp-config.php. These take effect immediately and override whatever is sitting in the database.define( 'WP_HOME', 'https://example.com' );
define( 'WP_SITEURL', 'https://example.com' );.htaccess to rule out a redirect rule, then deactivate redirect and SSL plugins one at a time.That covers the loop. A harder cousin shows up when the move forces you to build redirects from scratch, and there is no clean tooling to do it for you. On the hardest kind of migration — a deep archive rebuilt on a new taxonomy — hundreds of legacy article URLs have to land somewhere sensible after the underlying relationships changed. There was no tidy old-path to new-path mapping waiting for me. I had to work it out by hand, ship a batch, watch the logs for the 404s I had missed, patch those, and go again. It took several rounds before the misses stopped. Tedious is the word. If a migration changes your category and URL structure, expect that grind rather than one perfect search-and-replace, and budget for it.
Three things tend to be behind a generic “page not found” that is not a standard 404. The new domain’s stored URLs are wrong, the homepage setting got lost in the import, or DNS has not finished pointing at the new server. Figure out which one and the fix is quick.
It shows up in three flavors after a move. Sometimes the whole site reads page not found because the stored Site URL still points at the old domain. Sometimes only the homepage breaks, because Settings → Reading dropped its “front page” assignment during the import. And sometimes the site just looks dead, because DNS is still resolving to the old host. Same symptom, three very different causes.
When images go missing after a migration, it nearly always comes down to one of two things. The database still references the old domain, or the image files in wp-content/uploads never made the trip. Which one it is decides the fix, and you can tell them apart in about ten seconds.
Right-click a broken image and open it in a new tab. Does the URL still carry your old domain? Then the database needs a URL update. Is the URL correct but throwing a 404? That means the files are missing from uploads. One quick check tells you everything.
Per Duplicator, run a search-and-replace across the database to swap the old domain for the new one. Reach for a plugin like Better Search Replace, or run the WP-CLI command that handles serialized data safely. The manual migration guide has the full walkthrough if you want it.
wp search-replace 'https://olddomain.com' 'https://newdomain.com' --skip-columns=guid --precise --dry-runRead the dry-run report first. Then re-run without --dry-run to apply it for real. Flush permalinks to finish.
wp-content/uploads on the new host and confirm the year/month folders and image files are actually present. If they are missing, re-upload the folder from your backup or the old server.755 and file permissions to 644 so the server can serve them.Files present but the Media Library blank? Then the database lost its attachment records. A plugin like Media Sync rescans wp-content/uploads and rebuilds those entries. Clear all caches once it finishes.
Here is the case nobody warns you about. Sometimes the images are perfectly fine and the page builder is the one hiding them. I ran into this on a building-materials and tile store, roughly 2,000 products. Every page and post had been built in Divi, and I mean built. Completely dependent on Divi shortcodes and proprietary markup. The content was effectively jailed inside that ecosystem. So when anything moved, images and layout referenced inside those shortcodes broke in strange ways that a search-and-replace never went near. The job turned into custom parsing scripts. I processed every product, every page, every post, stripped out the Divi shortcodes and builder markup, and rebuilt it as clean, plain content. The site landed on standard WordPress with zero paid-builder dependency, every feature intact, and performance up more than 200%. The lesson stuck with me. If your broken images live inside builder shortcodes rather than the database or the uploads folder, no media plugin on earth will fix them. You have to clean the markup itself.
When All-in-One WP Migration “is not working,” the culprit is almost always the import upload limit. Your file is bigger than the server’s allowed upload size. Or the import runs out of execution time or memory and stalls halfway through, leaving you staring at a frozen progress bar.
Per the plugin developer (ServMask), the upload limit you hit comes from your hosting provider’s PHP configuration, not the plugin. The free plugin imports any size your server allows. Your server is the thing capping it, not the tool. Imports also die mid-run when PHP max_execution_time or memory is set too low for a large package.
upload_max_filesize and post_max_size (for example to 256M) in your host’s PHP settings or php.ini. This is the cleanest fix.max_execution_time and PHP memory so a large import can finish.constants.php to raise the limit. That trick is dead. Newer plugin versions stripped out the constant entirely, as ServMask documents. Skip the outdated file edits, fix the server PHP settings, or use the official extension.Large site, and the import keeps dying on you? Stop fighting upload limits. Switch to a tool built for big sites. Duplicator and Migrate Guru both handle large transfers far more gracefully. The best WordPress migration plugins roundup compares your options, and the All-in-One WP Migration guide has the full upload-limit walkthrough.
Nearly everything on this page is avoidable. You just have to know where it bites before it does. The table below maps each error to the one step that heads it off, so your next move stays clean.
| Error | Root cause | Prevention |
|---|---|---|
| 404 / page not found | Rewrite rules and permalinks did not transfer | Flush permalinks immediately after import; confirm URLs in Settings |
| Error 500 | Bad .htaccess, low memory, plugin conflict, PHP mismatch | Match PHP version on the new host; raise memory; keep a clean .htaccess |
| Database connection | Wrong DB credentials in wp-config.php | Update all four DB values and grant the user access before launch |
| Too many redirects | Mismatched site URLs or forced HTTPS | Set WP_HOME and WP_SITEURL; align SSL/CDN settings |
| Images not showing | Old URLs in DB or missing upload files | Run a serialized-safe search-replace; verify uploads transferred |
| All-in-One import stalls | Upload/restore limit, low execution time | Raise server PHP limits or use the Unlimited Extension |
Two habits prevent more pain than the rest combined. First, a serialized-safe search-and-replace for the domain change. That single pass heads off the redirect, image, and broken-link errors all at once. Second, a permalink flush the moment the import finishes, which kills the 404s before they start. Make both standard and most of this list simply never happens to you. The full process lives in the WordPress migration guide.
Every error on this page is fixable, and you now hold the cause and the fix for each. The pattern barely changes. Confirm the stored URLs. Confirm the database credentials. Confirm the rewrite rules and file paths actually moved. Get those three right and a WordPress site comes back to life fast.
Now for the harder truth the error list above does not show you. Across the migrations I have done, moving the content was usually the easy part. Preserving the years of accumulated SEO value attached to it was the war. On the toughest of those jobs that gap is stark. The files come over fine. What nearly breaks you is the taxonomy underneath them, deep and densely interconnected and many-to-many, where one publication might belong to several classifications and categories at once. Those relationships drove the URLs, so getting them wrong meant rankings quietly bleeding out through dead links. None of that shows up as a tidy 404 you can flush away in two clicks. It is the kind of damage you only catch weeks later in your search traffic, which is exactly why it is worth getting right the first time.
So here is my honest take. If your site is live, earning money, or you just do not want to be editing production files under pressure, hand the move off. A managed WordPress Migration covers a staged transfer, a full search-and-replace, redirect mapping, and post-launch QA, so these errors get caught long before a visitor ever meets one. Planning a move? Start with a free pre-migration audit to baseline your current site, then read the moving to a new host walkthrough.
Enter your website and get a free 60-second performance, SEO & accessibility report.
~60 seconds · No login