Home › Knowledgebase › KB-1145

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.

Quick Tip: Need immediate assistance? 💻 Open a Ticket

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

  1. Access your WordPress files via your hosting control panel or FTP client.
  2. Locate and edit the wp-config.php file.
  3. Add the WordPress site URL constants to force the correct address.
  4. Save the file and clear your browser cache.
  5. 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

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?

Need more help? If the issue persists after trying these steps, please open a support ticket and our team will assist you.

💻 Open a Ticket