WordPress Login Redirect Loop After Changing Hosting Providers
Summary
This guide helps you troubleshoot and resolve: WordPress Login Redirect Loop After Changing Hosting Providers. Follow the steps below to fix the issue.
Common Causes
After migrating your WordPress website to a new hosting provider, you may encounter a redirect loop when attempting to access your administration dashboard. This typically occurs because the WordPress database still references the previous server's URL, causing the browser to bounce between the old and new addresses without ever loading the login screen. This guide will help you resolve the issue by updating your site address and clearing cached redirects.
Quick Fix Steps
- Access your WordPress files via your hosting control panel or FTP client.
- Locate and edit the
wp-config.phpfile. - Add the WordPress site URL constants to force the correct address.
- Save the file and clear your browser cache.
- Attempt to log in to your WordPress dashboard again.
Detailed Instructions
Step 1: Access your website files
Log in to your hosting control panel and open the File Manager. Alternatively, connect to your web server using an FTP client such as FileZilla. Navigate to the root directory of your WordPress installation, which is typically named public_html or www.
Step 2: Edit the wp-config.php file
Locate the file named wp-config.php. Right-click the file and select Edit or Code Edit. Scroll to the bottom of the file, just before the line that reads /* That's all, stop editing! Happy publishing. */.
Step 3: Add the URL constants
Paste the following lines into the file, replacing https://yourdomain.com.au with your actual domain name:
define('WP_HOME','https://yourdomain.com.au');
define('WP_SITEURL','https://yourdomain.com.au');
Click Save to apply the changes.
Note: If your website uses an SSL certificate, ensure you use https://. If you do not have SSL installed yet, use http:// temporarily until your certificate is active.
Step 4: Clear your browser cache
Redirect loops are often cached by your web browser. Clear your browsing data or open your website in a private/incognito window to ensure you are not loading a cached redirect.
Step 5: Log in to WordPress
Navigate to your login page, usually located at yourdomain.com.au/wp-admin. Enter your credentials and verify that the dashboard loads correctly without redirecting.
Troubleshooting
If the redirect loop persists
- Check that your domain's A record and CNAME record are pointing to the correct IP address for your new hosting server.
- Ensure DNS propagation has completed. Changes to domain records can take up to 48 hours to update globally, though they are often faster within Australia.
- Disable any caching plugins by renaming their folder in
wp-content/pluginsvia your file manager. - Clear any server-side caching enabled within your hosting control panel.
- Alternatively, update the siteurl and home options directly in the WordPress database via phpMyAdmin in your hosting control panel.
Warning: Avoid changing the WP_HOME and WP_SITEURL values inside the WordPress dashboard while locked out, as this will not override the database values causing the loop.
Updating your WordPress settings permanently
Once you can access your dashboard, navigate to Settings and then General. Confirm that the WordPress Address (URL) and Site Address (URL) fields match your new domain. You can then remove the constants you added to wp-config.php if you prefer to manage these settings within the dashboard.
If you continue to experience login issues after following these steps, contact your hosting provider's support team for further assistance.
Still Having Issues?
💻 Open a Ticket