When I enter http://example.com/wordpress/wp-admin it is redirecting to wp-login.php page.

I checked the index.php of the wp-admin folder and checked the file, it is including wp-config.php, wp-settings.php, wp-load.php of the root folder and some files in wp-include folder but I am unable to figure out which function is redirecting the wp-login.php file while entering http://example.com/wordpress/wp-admin. I even checked auth_redirect() function.

  • wp-login.php is to take your username & password and with 'em you can still enter into your admin area. So what exactly the problem is? – Mayeenul Islam Sep 30 '13 at 7:06
  • Are you saying you cant see your admin dashboard even after you are logged in as the admin? – Maruti Mohanty Sep 30 '13 at 7:09
  • @MayeenulIslam...I dont have any problem. While entering the url "example.com/wordpress/wp-admin" it is redirecting to "example.com/wordpress/wp-login.php" file so I Just want to know that where the code is where it is redirecting to wp-login.php file. I have gone through the code but unable to find the code where it is redirecting to wp-login.php. – MagentoBoy Sep 30 '13 at 7:19

Each call to an admin page loads the \wp-admin\admin.php file.

For example, from the \wp-admin\index.php file:

/** Load WordPress Bootstrap */
require_once( dirname( __FILE__ ) . '/admin.php' );

In that file auth_redirect() is called.

From \wp-admin\admin.php:

require_once(ABSPATH . 'wp-admin/includes/admin.php');


// Schedule trash collection
if ( !wp_next_scheduled('wp_scheduled_delete') && !defined('WP_INSTALLING') )
    wp_schedule_event(time(), 'daily', 'wp_scheduled_delete');


auth_redirect() does the redirect. From the inline docs:

 * Checks if a user is logged in, if not it redirects them to the login page.
 * @since 1.5
function auth_redirect() {


    $login_url = wp_login_url($redirect, true);


I had the same problem, I tried the best possible ways.

  1. Uploaded the fresh files in WP-Includes and WP-Admin, it didn't work.
  2. I tried changing the name of plugin folder and created a blank plugins folder, it didn't work.
  3. I tried uploading the fresh files of the theme, it didn't work.
  4. I renamed the theme folder, no solution.
  5. List item

**5. Finally I changed the wordpress password through phpmyadmin, using the new password worked for me.****

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.