How To: Westhost WordPress Login Fix

This one took me all day to figure out, so I figured someone else could benefit from it.

A client has her site hosted at Westhost, who recently made the decision to disable all login pages for WordPress because they came under a brute force attack and their servers were getting slammed. They posted a workaround to be able to get back to the WordPress dashboard, but nothing on how to fix the bajillion locations within a WordPress installation that reference or redirect to the login page. So, for example, you could get to your new login page directly, but not if you typed in “yoursite.com/wp-admin”

After some digging and mildly obscene near-cussing, I found the page you need to edit to get things redirecting correctly.

WARNING: This requires a bit of savvy and may render your website (frontend and backend) unusable. I am not able to help troubleshoot or fix things. If you don’t know what you are doing, stop. If you are comfortable with FTP and very basic PHP, continue. Also, you are changing core WordPress files here. That’s never recommended, and once you do, any update to wordpress will get rid of these changes. There, enough disclaiming.

FTP into your server and find the file at /wp-includes/general-template.php

Change all instance of “wp-login.php” to whatever your new url is. If you followed the instructions on Westhost’s support page, it would be “wp-login_new.php” There should be 5 instances. In this client’s instance (an older version of wordpress) it was lines 218, 238, 276, 319, and 341.

Save and re-upload that file, and your site should be working correctly.

In the event that they (Westhost) change anything, it might break again.

Hope that saves you hours of looking. Oh, and I recommend switching away from WestHost to MediaTemple. WELL worth the price difference. Here’s my affiliate link: http://benlikes.us/mediatemple

One Reply to “How To: Westhost WordPress Login Fix”

Comments are closed.