Login redirect to the admin page
-
Hi, I changed the login slug to something other than the ‘wp-admin’. Right now this is what happens: I login (as the administrator) and I get redirected to the homepage and I again need to manually enter the wordpress dashboard URL to get there. However when anyone logs in I want them to go the the wordpress dashboard (wp-admin).
Here is the code that I found in the WordPress Codex that lets me redirect folks to the backend page after they login:
add_filter( 'login_redirect', create_function( '$url,$query,$user', 'return admin_url();' ), 10, 3 );
I’ve just changed the “return home_url();” to “return admin_url();”. However, this does not work and I’m still being redirected to the homepage after login. What am I doing wrong here?
- The topic ‘Login redirect to the admin page’ is closed to new replies.