How can i redirect user after session timeout in multisite to my custom Page?

Normally Wordpress multisite redirects users to example.com/subdirectory/wp-login.php


You can filter the login_url:

add_filter( 'login_url', 'wpse103239_login_url' );
function wpse103239_login_url() {
    return 'your-login-url';

See also this answer for a bunch more options.


The login_url filter is mentioned in the Codex page for wp_login_url(), but there doesn't seem to be a Codex page for the filter itself.

  • No problem. If my answer worked for you, please mark it Accepted. – Pat J Jun 17 '13 at 19:16
  • I just added your code and I realized that I use it already for make the login mydomain.com/login .....so I think it has nothing to do with "session timeout" – Ghinnersmee Jun 17 '13 at 22:47
  • I'm not sure I see the difference between "session timeout" and "need to log in". – Pat J Jun 17 '13 at 22:51
  • ok ,in multisite When the session timeout ends the user is redirects to example.com/subdirectory/wp-login.php ...in my case I want to redirect my users to my login page example.com/login already set with your code – Ghinnersmee Jun 17 '13 at 23:26

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.