11

Is it possible to change the Default "Home" admin page when logging into the WordPress Dashboard?

I thought about a couple of possibilities...

  1. Substitute the content on the Dashboard home page with custom content.
  2. Redirect to a different admin page within the WordPress Dashboard upon successful login.

If it is possible to do either of the two options, what hooks would you recommend utilizing?

1 Answer 1

8

Easy enough, decided to just do the redirect option. I used the wp_login action hook. You could also probably use this for redirecting your users to ANY page on your website. You can also check user capabilities from the $user Object passed in as a function parameter if you want to send different user levels to different pages.

/* Redirect the user logging in to a custom admin page. */
function new_dashboard_home($username, $user){
    if(array_key_exists('administrator', $user->caps)){
        wp_redirect(admin_url('admin.php?page=c2c-overview', 'http'), 301);
        exit;
    }
}
add_action('wp_login', 'new_dashboard_home', 10, 2);
0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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