Login loop and administrator access issues
- You are logged in, but why are you being redirected back to the login screen?
- The reason why these problems have been occurring frequently since the domain was changed.
- The address and cookies should be checked before the password.
- The most common points of difficulty when attempting to resolve issues directly are:
- Here is the order in which you should check when you cannot access the administrator screen:
- Just because someone has entered once, it does not mean the migration is complete.
- Please choose the appropriate option based on the situation.
- Dividing the migration scope using LUX Content Migration.
- Frequently Asked Questions.
- WordPress-related links
Even though the password was entered correctly, the administrator screen did not appear; instead, the login screen reappeared. It was as if the door had been opened, but after reaching the end of the hallway, it led back to the entrance hall.
This phenomenon often occurs immediately after changing the domain or transferring the server. Is the password actually incorrect, or has the login been successful, but WordPress is not remembering it?
You are logged in, but why are you being redirected back to the login screen?
The WordPress login address is wp-login.php, which is located at the root of the website. If you are logged out and try to access wp-admin, you will be redirected to the login screen.
The problem is that the same issue occurs even immediately after logging in. If the authentication cookie issued during the login process is not transmitted to the next request, WordPress continues to consider the user to be logged out.
WordPress uses the `wordpress_[hash]` cookie for the administrator area and the `wordpress_logged_in_[hash]` cookie to indicate login status. If this cookie is missing, expired, or invalid, you will need to log in again.
In other words, even though the screen indicates a successful login, the access card did not make it to the next door. The access card was issued, but the security guard did not see it.
The authentication cookie has been lost.
The reason why these problems have been occurring frequently since the domain was changed.
When you move the website to a new address, the address settings within WordPress, the use of HTTPS, and the scope of cookie application may also change. However, if any one of these three elements still points to the old address, the login process will be disrupted.
If the address changes, the cookies will also change.
The official WordPress login guide also addresses login redirection loops and excessive redirections as separate issues. The troubleshooting process begins with elements directly related to the login flow, such as cookies, address settings, and plugins.
The official cookie guide explains that if cookie-blocking problems arise after a site migration, users should try clearing their browser cookies and server cache. Surprisingly, it is sometimes not a massive server outage but a single old cookie standing guard at the door.
Furthermore, if a previous address remains in the database, it can cause problems not only with links and theme displays, but also with redirection after logging in. If you have changed your address, you need to check not only the address displayed on the screen, but also the stored address.
The address and cookies should be checked before the password.
If a login loop occurs, it is important not to immediately assume it is a password issue. First, verify that the new domain and HTTPS settings are consistent with the address settings in WordPress.
The key values are four in number. They are WP_HOME and WP_SITEURL in the wp-config.php file, and siteurl and home in the database.
If WP_HOME and WP_SITEURL are specified in wp-config.php, they will take precedence over the home and siteurl values in the database. However, these constants do not automatically change the values in the database.
Therefore, inconsistencies can arise, such as when a file contains a new address, while the database still contains the old address. The official WordPress migration documentation instructs users to include both addresses and to avoid adding a trailing slash at the end.
Files and databases may differ from each other.
Another clue lies in the use of HTTPS and cookies. If HTTP and HTTPS are mixed, if the COOKIE_DOMAIN setting does not match the new domain, or if the server configuration caches wp-login.php and cookie-based sessions, the login status may be lost.
If the `wordpress_test_cookie` cannot be set during the login process, a cookie blocking error may occur. Therefore, you should not assume that cookies are working correctly simply because the login screen is displayed.
The most common points of difficulty when attempting to resolve issues directly are:
If you can access the administrator screen, you can check the address in the settings menu. However, if the login loop starts, you will not be able to access that menu itself. In this case, you need to directly open the wp-config.php file or the wp_options table in the database.
Both file access permissions and database access permissions are required.
The problem may not be resolved by simply changing one address. The file may contain the new address, while the database still contains the old address. Alternatively, even if the address is correct, the user may be redirected back to the same screen if the HTTPS, COOKIE_DOMAIN, or cache settings are incorrect.
Changing values arbitrarily makes it more difficult to identify the root cause. In particular, modifying a database without a backup, or disabling plugins and the cache simultaneously, makes it impossible to determine what resolved the issue.
To prepare a recovery path in advance, you can consider the “Whole site backup / restore” add-on for LUX Content Migration. This feature backs up and restores the database, theme, plugins, uploaded files, and settings into a single file.
The function does not diagnose issues related to login cookies or URL mismatches. Therefore, after creating a backup, address, HTTPS, and cache checks must be performed separately. This function can be used to clearly define the scope of operations when it is necessary to have a state that can be reverted before the check.
While a direct inspection is possible, it is easy to misjudge the scope of the inspection.
Here is the order in which you should check when you cannot access the administrator screen:
First, clear your browser cookies and cache, and then access the new HTTPS address again. This step, although simple, is the first step in clearing the memory of the previous address.
If you can access the administrator screen, check the WordPress Address (URL) and Site Address (URL) in the settings. Verify that both values match the new address and the HTTPS protocol, and then save the changes.
If the administrator screen is completely inaccessible, start by creating a backup. Next, if file access is possible, check the WP_HOME and WP_SITEURL values in wp-config.php. If you can access the database, update the siteurl and home values in the wp_options table to the new address.
Do not change your address without a backup.
After correcting the address, if the problem persists, try disabling the plugin by renaming the plugin folder. If the problem remains, check whether wp-login.php and the login session are excluded from the cache.
- Delete browser cookies and cache.
- Verify WP_HOME and WP_SITEURL.
- Check siteurl and home.
- Plugin phased deactivation.
- Verify that the login address and sessions are excluded from the cache.
By following this sequence, you can reduce the need to change passwords or tamper with files indiscriminately. First, this approach focuses on fixing the authentication channel, not the authentication information.
Orderliness is a safety measure.
Just because someone has entered once, it does not mean the migration is complete.
The emergency recovery settings can restore administrator access, but leaving temporary settings in place will cause the following problems. Successful access is like being discharged from the emergency room; it doesn’t mean you’ve completed a full check-up.
If you set the RELOCATE option to true, you must remove it after the recovery process is complete. The official WordPress documentation warns that leaving it enabled may allow an attacker to change the site URL in certain environments.
Temporary settings must be reverted.
If WP_HOME and WP_SITEURL are fixed in a file, you will not be able to modify those addresses in the administrator panel. If these constants are deleted later, the system may revert to the old addresses that were stored in the database. Therefore, it is necessary to record the relationship between the file and the database.
Multisite installations require extra caution. Because the domain and path information is stored in multiple tables, you must carefully review `wp_blogs`, `wp_site`, and the `home` and `siteurl` settings for each site.
Conversely, if you have only changed the domain on a single site, do not broaden the scope. The safest approach is to adjust the four addresses based on the new HTTPS address, and to exclude plugins and cached data one by one.
Keep the inspection narrowly focused on the single site.
If you are using a CDN, proxy, cache, or login plugin, first check the cookie domain and cache exceptions. Only when the problem persists should you exclude related elements one by one to avoid missing the root cause.
Please choose the appropriate option based on the situation.
If you can access the administrator panel, start by checking the addresses on the screen and clearing the cookies and cache. If the problem persists even with the correct addresses, then check the plugins and cache settings in order.
If you cannot access the administrator panel, make a backup, then check the WP_HOME and WP_SITEURL values in the wp-config.php file or the siteurl and home values in the wp_options table. You must check that the values in both the file and the database are consistent with the new HTTPS address, and do not modify only one of them.
Websites that use CDNs or proxies should exclude the login address and session data from the cache. For multi-site installations, the scope should be expanded to include `wp_blogs` and `wp_site`. If direct modification is difficult or if it is challenging to secure backup and recovery paths, migration and inspection tools can be used, but a manual verification step remains necessary to confirm the results.
Ultimately, login loops usually occur not because of the password itself, but because of mismatches between the new address, the WordPress URL setting, HTTPS configuration, authentication cookies, and cached data.
If you can access the administrator panel, check the addresses displayed on the screen. If you cannot access the administrator panel, correct the addresses directly in the files or database after making a backup. Then, clear the cookies and cache, and check the plugins and proxy settings in order.
Dividing the migration scope using LUX Content Migration.
If you are performing a domain change and server migration simultaneously, you need to separate the tasks of resolving login issues and determining which content to move. LUX Content Migration provides an export and import function that allows you to export content from the existing site as files and import it into the new site. With the “Content only” option, you can select posts, pages, categories, comments, authors, custom fields, and media.
If you only need to migrate the settings and not the entire site, you can use the “Site settings only” option to separately migrate the General, Reading, and Discussion settings, permalinks, widget placement, and menu structure. This feature is designed to separate the migration of content and settings, so you must separately verify the consistency of WP_HOME, WP_SITEURL, siteurl, home, HTTPS, and authentication cookies.
Before importing, you can preview the new posts and comments that will be created, as well as the number of required images. If a problem occurs after importing a specific category, you can use the “Roll back” function to delete the posts that were created during the import process and revert to the previous state.
If you are planning to change your domain, it is safer to keep the login recovery and content migration as separate tasks. When using LUX Content Migration, export the content or settings you want to move as a file, and before importing, you can preview the items that will be created.
If problems arise with the imported categories, you can use the “Roll back” feature to revert the newly created post. However, the checks for WP_HOME, WP_SITEURL, siteurl, home, HTTPS, and cookies must be completed separately and in the order specified in this document.
Frequently Asked Questions.
Q. What is the most common reason why, after logging in, the user is redirected back to wp-login.php?
A. This is because the login cookie is not being passed to the subsequent request, or because WordPress is redirecting to the previous address. First, check the URL settings and cookie flow, specifically regarding the new address and HTTPS.
Q. If you cannot access the administrator section at all, where do you change the address?
After backing up the data, you can change the values of WP_HOME and WP_SITEURL in the wp-config.php file, or the values of siteurl and home in the wp_options database, to the new address.
Q. Can this problem be easily solved using a tool?
A. An automatic migration and verification tool that identifies address and cookie mismatches can be helpful. However, after the backup, a person must verify the results and ensure that the file, database, and cache settings actually point to the same address.
Q. What recovery points should be prepared before migrating to WordPress?
A. Before investigating the cause of the login loop, it is essential to first secure a way to restore the files and database.
The LUX Content Migration “Whole site backup/restore” add-on backs up and restores the entire website, including the database, theme, plugins, uploaded files, and settings, into a single file. If you only want to migrate content or settings, you can specify “Content only” or “Site settings only” as the scope. However, the consistency of URL, HTTPS, and cookie settings must be verified separately.