I mean when we have subdirectory install and /wp-admin/ is not referencing to directory wp-admin, but wordpress stills redirects and not just for wp-admin slug but also for admin and dashboard and maybe some more?

Where is this happening? It is not in rewrite rules? Is it hard coded?

I don't want this behavior and i want to turn it off, but i want clean solution, nota check url and if slug is present than do my redirect.


When you visit example.com/login you're redirected to the login page, and example.com/dashboard redirects to the admin area. How can I disable this behaviour or change the redirect location?

I have my own login and dashboard interfaces and would like to use those instead

  • So you want to change where the user goes when they login from the WP Admin dashboard to somewhere else? – Tom J Nowell Sep 28 '15 at 20:51
  • No, i want to know where are these endpoints settled. I defined my own endpoint for login and wp-admin, but i want to turn off theese – Dejan Milosevic Sep 28 '15 at 21:25
  • hmmm, so do you mean the rewrite rules? Or do you mean the functions that actually put the URLs on the page? You've not provided any outright examples so it's a little difficult to determine what you mean, there's still some ambiguity left in your question – Tom J Nowell Sep 29 '15 at 11:14
  • Man, just type yourwordpress.com/dashboard and it will redirect to wp-admin. I want to know where in core files this happens, and is there filter for this, is it uses rewrites or hard code redirect, i dont get how do you dont understend my question – Dejan Milosevic Sep 29 '15 at 12:08
  • Ah! You mean the /login and /dashboard redirects! That clears things up :) A lot of people are unaware those exist, and there are other ways to redirect to those locations – Tom J Nowell Sep 29 '15 at 13:13

you can remove this functionality by adding this code in a plugin or theme

remove_action( 'template_redirect', 'wp_redirect_admin_locations', 1000 );

This will remove all of dashboar, login, admin so if you will want some of them to still be there you will have to write your own replacement function to wp_redirect_admin_locations and hook it after you removed the hook to the original

| improve this answer | |

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.