Fix a WordPress site after a migration
Most problems after a WordPress move show up in the first hour, and most have a short fix. Here are the common ones, each with the fix the WordPress documentation gives.
The fixes come from the WordPress developer documentation, checked on 24 November 2026.
Posts and pages give a 404 error
The home page works, but every post says page not found. The address rules in the .htaccess file are missing. In wp-admin, open Settings, then Permalinks. Opening that screen rebuilds the rules.
If WordPress cannot write the file, the screen says "You should update your .htaccess now." and shows the rules to copy into it. This is the default block from the WordPress docs:
# BEGIN WordPress
RewriteEngine On
RewriteRule .* - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
RewriteBase /
RewriteRule ^index\.php$ - [L]
RewriteCond %{REQUEST_FILENAME} !-f
RewriteCond %{REQUEST_FILENAME} !-d
RewriteRule . /index.php [L]
# END WordPress"Error establishing a database connection"
WordPress cannot reach its database. The docs say this is "usually caused by an error in your wp-config.php file". Open wp-config.php at the new host and check the database name, user, password and host. If they are right, ask your host whether the database server runs.
A white screen
The page is blank and shows no error. Most of the time a plugin does not work on the new server. To turn all plugins off, rename the folder wp-content/plugins to plugins_old in the file manager or over FTP.
If the site comes back, rename the folder back and turn the plugins on one by one in wp-admin until you find the broken one. If the plugins are fine, switch to a default WordPress theme.
"Internal Server Error"
The docs name a broken .htaccess file as the most likely cause. Rename it to .htaccess_old, then open Settings, then Permalinks to make a new one. Copy your own redirects back from the old file.
Links or images still go to the old address
The site works, but links, images or the login send you to the old domain. First open Settings, then General. WordPress Address (URL) and Site Address (URL) should both be your domain, with https:// and no slash at the end.
Then replace the old address in the content. Try it with --dry-run first, then run it again without it:
wp search-replace 'https://old-domain.com' 'https://yourdomain.com' --skip-columns=guid --dry-run
A migration plugin such as PanelAlpha Migrator makes this change during the copy, so you only need it after a move by hand.
You cannot reach wp-admin
After a full copy, the new site has the users of the old one, so log in with your old username and password. If the login page sends you to the old domain, set the address in wp-config.php instead. Add these lines with your domain:
define( 'WP_HOME', 'https://yourdomain.com' ); define( 'WP_SITEURL', 'https://yourdomain.com' );
While these lines are in wp-config.php, you cannot change the address in Settings, General.
- WordPress developer docs: Migrating WordPress
- WP-CLI: wp search-replace
- WordPress developer docs: Common WordPress errors
- WordPress developer docs: Apache HTTPD and .htaccess
- WordPress docs: Settings Permalinks screen