Redirection Issue

Hello Support Team,

User after login from classifed it is redirecting user to the backend of WP. Please try create account on classfied and try to login. http://202.166.207.19/guilford-gazette/

Another surprising things we found is that from http://tinyurl.com/register-classfied when register then they have just 2 field i.e username and email. Then a email notification follows with the URL that takes to user to the backend of the site and after the user set the password then it will redirect to the backend.

But when login/register from http://202.166.207.19/guilford-gazette/register/?step=register there is No such hassel on creating account or login.

Can’t we just use the second register link to the classfied account creation ? as either way the main purpose is to create a account.

  • Sajid
    • DEV MAN’s Sidekick

    Hi Ricardo,

    Hope you are doing good today :slight_smile:

    It appears that you are using Membership 2 plugin as well. Both plugins have their own registration process and forms but ultimately creates a WordPress user. So you have to decide which plugin you want to go with for registration and login of WordPress user.

    So what you can do here is, if you want to go with membership 2 then hide all links of user registration and login of classifieds plugins. You can do that manually and in case like you want to give create a classified then you can hide that link from visitors and show that to members/logged in users only by using the Advanced menu protection add-on (you can replace individual menu items or complete menu).

    Remove links of classifieds plugin that you can manually, enable Advanced menu protection from Membership 2 -> Add-ons and configure the rules from Membership 2 -> Protection Rules -> Replace Menus.

    Hope that helps! Feel free to post a reply if you need further assistance :slight_smile:

    Best Regards,

    Sajid

  • mariawhalen
    • Flash Drive

    You may also try using a redirect plugin (this worked in my case) like one of the following:

    https://wordpress.org/plugins/redirect-after-login/

    https://wpmudev.com/project/login-redirect/

    https://wpmudev.com/project/logout-redirect/

    Make sure you set the role of the people you want to redirect. With classifieds I create a merchant role and made them redirect to the my classifieds section.

    Then I removed access to the dashboard and removed the top dashboard with the following code in my themes function.php :

    /****
    Hide dashboard from users other than admins, and hide top boar
    ****/

    add_action( 'init', 'blockusers_init' );
    function blockusers_init() {
    if ( is_admin() && ! current_user_can( 'administrator' ) &&
    ! ( defined( 'DOING_AJAX' ) && DOING_AJAX ) ) {
    wp_redirect( home_url() );
    exit;
    }
    }

    add_action('after_setup_theme', 'remove_admin_bar');
    function remove_admin_bar() {
    if (!current_user_can('administrator') && !is_admin()) {
    show_admin_bar(false);
    }
    }