Back to Community

Fixing URL Redirects and Path Issues After a WordPress Migration

25 threads Sep 16, 2025 PluginAll-in-one wp migration and backup

Content

Migrating a WordPress site with the 'All-in-One WP Migration and Backup' plugin is usually a smooth process, but a common frustration occurs when your new site redirects to the old URL or displays broken paths. This guide will explain why this happens and walk you through the most effective solutions to get your migrated site working correctly.

Why Do URL Redirects Happen After a Migration?

The core of this issue almost always lies in the database. During the export/import process, the plugin replaces all instances of the old site's URL with the new one. However, some references to the old URL can be missed or re-introduced. This can happen because of hardcoded URLs in theme files (like functions.php), settings in other plugins, or specific server configurations that override the database settings.

Step-by-Step Troubleshooting Guide

1. Verify and Update Database URLs (The Primary Fix)

The first and most crucial step is to ensure the home and siteurl values in your database are correct.

  • Access your new site's database via phpMyAdmin (usually found in your hosting control panel).
  • Locate the wp_options table (the prefix may be different if you changed it).
  • Find the option_name rows for home and siteurl.
  • Confirm the option_value for both is exactly your new site's URL (e.g., https://yournewsite.com).
  • If they are incorrect, update them manually to the new URL.

2. Clear All Caches

Old data can be stubbornly held in various caches. After updating the database, clear all of them:

  • WordPress Cache: If you use a caching plugin (e.g., W3 Total Cache, WP Super Cache), clear its cache from the plugin settings.
  • Server Cache: Clear any server-level caching (e.g., Redis, Varnish). You may need to contact your hosting provider for this.
  • Browser Cache: Clear your browser's cache and cookies or test the site in an incognito/private browser window.

3. Check for Hardcoded URLs in Your Theme

Some themes hardcode the site URL into the functions.php file. This will override any database settings.

  • Navigate to Appearance > Theme Editor in your WordPress admin dashboard.
  • Select your active theme and edit the functions.php file.
  • Look for any lines containing your old URL (e.g., update_option('siteurl', 'http://old-site.com'); or define('WP_HOME', 'http://old-site.com');).
  • Remove or comment out these lines, replacing the old URL with your new one if necessary.

4. Investigate Other Plugins

As seen in the sample threads, a custom or security plugin can sometimes cause conflicts that revert URLs. To test for this:

  • Temporarily deactivate all plugins on your new site.
  • Check if the redirection issue is resolved.
  • If it is, reactivate your plugins one by one, checking the site after each activation, to identify the culprit.

5. Review Your .htaccess File

Incorrect rewrite rules in your .htaccess file can cause redirect loops or errors.

  • Access your site's root directory via FTP or your host's file manager.
  • Find and edit the .htaccess file.
  • The standard WordPress block should look similar to this. Ensure there are no odd redirect rules pointing to your old site.
# 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

6. Update the Uploads Path

If you see errors about an invalid upload path, the full server path to your uploads directory might be incorrect.

  • In your WordPress admin dashboard, go to Settings > Media.
  • Look for the "Store uploads in this folder" option.
  • It should typically be set to wp-content/uploads. If it contains a full server path from your old host, change it back to the default value.

Final Checklist Before You Start

  • DNS Propagation: If you've changed your domain's nameservers, wait for propagation to complete fully before testing. Alternatively, use a hosts file modification to preview the new site.
  • Permalinks: After import, always go to Settings > Permalinks and simply click "Save Changes" twice to refresh the rewrite rules.

By methodically working through these steps, you can resolve the vast majority of post-migration URL issues. The problem is rarely with the 'All-in-One WP Migration and Backup' plugin itself but rather with lingering configuration data that needs to be cleaned up manually.

Related Support Threads Support