More Privacy Options
Redirect back to blog instead of dashboard (3 posts)

  1. Michael
    Posted 5 years ago #

    Would it be possible to have an option for a site administrator to set whether the newly logged in user is sent to the blog home instead of to the dashboard. The dashboard redirect is confusing for users, especially those who would only have subscriber access.

    I am currently directly hacking the plugin (which is would not be maintainable for our organization long-term) changing the following in three places.

    header('Location: ' . wp_login_url());


    header('Location: ' . wp_login_url()."?redirect_to=". home_url());


  2. Doesn't the plugin automatically redirect the user to exactly where they tried visiting when prompting for a login? o_O

  3. David Sader
    Plugin Author

    Posted 4 years ago #

    Does commenting out the redirect filter(~line 67) altogether help?
    add_filter( 'login_url', 'ds_my_login_page_redirect' );
    //add_filter( 'login_url', 'ds_my_login_page_redirect' );

    You can use your own plugin to filter the login redirect as I have done there:

    function ds_my_login_page_redirect() {
    //	$redirect = urlencode( $_SERVER['REQUEST_URI'] );
    	$redirect = home_url();
    	$page = get_option( 'siteurl' ) . '/wp-login.php?redirect_to=' . $redirect;
    	return $page;
    add_filter( 'login_url', 'ds_my_login_page_redirect' );

    This way all your calls to wp_login_url in your templates/plugins will redirect as you want.

Topic Closed

This topic has been closed to new replies.

About this Plugin

  • More Privacy Options
  • Frequently Asked Questions
  • Support Threads
  • Reviews

About this Topic