What to Do When WordPress Wp-Admin Redirects to Homepage

What to Do When WordPress wp-admin Redirects to Homepage
Image credit: Pakaj Patel

So, after getting a WordPress-powered website, it’s only reasonable you’ll want to log in so you can have the opportunity to adjust a few things. Well, it appears you can’t. Somehow, your WordPress wp-admin redirects to the homepage. There’s almost nothing more annoying than not being able to do something as simple as gaining access to your website. After all, you’re the admin of your site, and a hack isn’t the problem. It’s frustrating feeling like a visitor in your own space, right? Well, what you’re experiencing is a WordPress login redirect loop and we are here to help to rectify this. We will first explain exactly what a redirect loop is and the best ways to handle it in order to gain access.

Want to Improve your Website’s SEO? Check Out 5 Best Yoast Alternatives

What to Do When WordPress wp-admin Redirects to Homepage
Image credit: LunchPresso

WordPress Wp-Admin Redirect to Homepage – How Does it Happen?

What to Do When WordPress wp-admin Redirects to Homepage
Image credit: Stephan Philips

There are a few things that can get you stuck in the WordPress login page.Here are some of them:

1. Cookies and Cache Problems

Cookies are data-containing files that websites send into your browser. Besides storing information, they also provide a robust and tailor-fit browsing experience. Basically, they remember your login password/username, items you clicked on and email address. When it comes to WordPress, there are two types of cookies by default; session and comment cookies.

The former carries your authentication details in addition to admin area settings. These cookies set whenever you log in to WordPress. The latter, on the other hand gives your site visitors’ details such as email address and name. It is automatically set when users visit your WordPress-powered site to drop a comment.

These cookies allow WordPress to auto-fill visitors’ details when they revisit your blog or website. Pretty cool right? But how do all these cool advantages lead to your WordPress wp-admin login loop problems? 

Whenever you try to login to your WordPress admin area, WordPress utilises session cookies to store details of authentication. The problem is, this saved cookie is prone to expiration because all session cookies are only valid for 15 days. Even if you update your WordPress wp-admin password, your browser cookies are still holding stale information from your WordPress site.

So, the result is that your expired cookies will override your current login request, which leads to the login loop. Similarly, the old version of your WordPress page may be in your browser’s cache, which could be trying to authenticate the login. 

2. Conflict Between Plugins 

There’s no unique or techie meaning of ‘conflict’ here; it merely implies disagreement of operation. The conflict between plugins is a result of the two more plugin operations antagonising each other or the system.

But plugins are amazing add-ons for your site as they are capable of powering virtually any feature or function you require. Sadly, as useful as plugins can be, they are often a source of many website errors such as login issue, bugs, performance challenges.

In some cases, they are the cause of white screen damage, widely referred to as the ‘white screen of death.’

Here’s the thing, it’s one thing to have a bad plugin, everyone knows a lousy plugin can be a large spoke in a wheel. All you need is to know what to do when this kind of plugins stop working the way you desire. On the other hand, it’s an entirely different thing to have useful plugins which work in conflict. Usually, the plugins you choose may likely come from different makers. 

Permit us to say it’s almost impossible to know if the specific code developers use to design their plug won’t antagonise the functions of another developer’s plugin. In some weird cases, it could even conflict theme or the version of your WordPress.

Therefore, if you have a whole lot of plugins within your setup, it doesn’t take rocket science to know the conflict in plugin operation will later develop. From an adequately coded plugin by a developer to a plugin update that isn’t incomplete, any of these issues can cause wp-admin redirect challenges.

3. Conflict With Theme

Themes, like plugins can also be responsible for your wp-admin redirect problems. Quite similar to plugins, themes also add extra functionality and features to your setup. Sadly, the presence of themes means you have additional codes running on your website. The fact that lots of the theme you adopt onto your sites are from third-party developers makes the risk of non-compatibility high, which could result in a conflict of operation.

How to Fix wp-login Redirects

Image credit: Stephan Phillips

Since the reason for the redirects isn’t ever displayed on your computer, you’ll have to do some troubleshooting in line with some of the possible causes. At this point, it’ll be great if you remember this heads up. Ensure you backup your WordPress before you engage any of the following methods as it’ll be disappointing to experience any loss of data.

Method 1: Clear Cookies

Checking your cookies should be one of the first steps to take. Since WordPress utilises cookies for authenticating logins, clearing your browser cookies is a good troubleshooting step.

If you are a Google Chrome user:

  • On the browser page, click on the browser settings menu.
  • Select ‘more tools’. 
  • Click the ‘clear browser’ settings (it will automatically launch the settings page with “clear browsing data” pop up on your screen).
  • Select clear cookies and site data.” 
  • Select “Clear Cached images and files.”
  • You then click on the “clear data” tab. This action will clear the cache of your browser. You do not need to need to disable your cookies, make sure your cookies settings are enabled. 
  • After all of the above is done, relaunch your browser and initiate a login into your WordPress. A lot of people do not clear their cookies, so this troubleshooting step usually resolved their WordPress wp-admin login redirect to home page issues. 

Method 2: Update your WordPress URL Settings

WordPress generally has a ‘Settings’ option that carries the URL of your WordPress-powered website. It also carries the URL you used while installing your WordPress. Let us assume you don’t have this WordPress wp-admin login redirects to homepage issue, when you log in, you’ll be able to see the two URLs when you click settings, under the general page. However, since you have login challenges, for now, you are logged out of your admin area. 

What you’ll need to do to rectify the problem is an edit to the word-config.php file. No worries if you don’t know what the config.php file is, we’ll breeze you through it in a minute. The wp-config.php is a special file wp-config.php located in WordPress that carries the essential settings for your WordPress installation. The values carried in your wp-config.php will override your WordPress admin screen settings. 

With either the aid of an FTP client online or file manager application on the dashboard of your WordPress hosting account, you can access the wp-config.php in the root folder of your site. Simply right-click in the wp-config.php file and select view/edit. Furthermore, all you need to do is add the following code immediately above the code that reads ‘stop editing.’

                   define( ‘WP_HOME’, ‘http://mysiteurl.com’ );
                   define( ‘WP_SITEURL’, ‘http://mysiteurl.com’ );

Note, that this is an example and you’ll have to type your domain name where ‘mysiteurl.com’ is above. After this is complete, save changes and try to intimate a login. If you can log in, then you are good to go otherwise try the next step.

Method 3: Delete .htaccess File in WordPress

When .htaccess file becomes corrupt, it can lead to internal server error asides the WordPress world-admin redirects to the home page. Just as you updated your WordPress URL settings, go and access your website via an online FTP client or file manager application on WordPress hosting account dashboard. Immediately you are in, go to the .htaccess file in your website’s root folder. Download it to your local computer (as backup). 

You can delete the .htaccess file from WordPress and the .htaccess file from your website. Go to the wp-admin directory, check if there is a .htaccess file. If you have any, delete them as well. Now that you have removed all corrupted .htaccess files, try to initiate login to your WordPress site. 

You’d be successful if the corruption of your .htaccess files were the actual problem. Since you would have gained access, go to settings now in your admin dashboard and enter the Permalinks page. Without making any changes, click on save. This action will automatically generate a new, uncorrupt .htaccess file for WordPress website. However, if you are not able to login after deleting your .htaccess not, there’s more. 

Find Out How to Promote Clickfunnels

WordPress wp-admin Redirects to Homepage: Avoiding the Issue

What to Do When WordPress wp-admin Redirects to Homepage
Image credit: Kevin Ku

Now that you know how to troubleshoot your way out the WordPress wp-admin redirects, wouldn’t it better to avoid it altogether?  Here are some useful tips.

  • Regularly clear your cookies.
  • When it comes to plugins and themes, these two bad boys can cause a whole lot of issues. But since you can do without them, ensure regular backup of your website.
  • Don’t make changes while your website is live, instead use a local site.
  • Make sure your plugins are updated. 
  • Again, when it comes to plugins, the fewer, the better. Sometimes, you don’t need the whole arsenal of plugins you have.
  • Protect your website by adopting functioning programs. If you can go for paid programs, that’s great. They’ll not just offer more than freebies can they also provide better security against unauthorised access.

WordPress Wp-Admin Redirects to Homepage: Conclusion

We hope you enjoyed the article and you now know some of the troubleshooting approaches to get out of the ‘WordPress wp-admin redirects to homepage’ issue. While practically everyone that owns a blog will probably experience this challenge, remember there are tips you to prevent the login loop from happening. It’s not pretty getting logged out of your website. Remember to drop a comment and share this much-needed information.