Setting Specific Page to send user to after login based on role

Hi,
is it possible to set a specific page that people to to after they login to a wordpress site? Also can this be done based on specific role that the user has? So subscribers will go to a certain page after login, editor, etc.

  • Patrick Freitas

    Hi cornelius_butler,

    How are you?

    Have you seen our Membership 2 Pro, this will allow you to create some users roles: https://premium.wpmudev.org/project/membership/

    We can do a "workaround" using our plugin:

    1. Create your "thank you" pages for all the memberships and note down their full URLs (no need to change "Thank You" page setting in Membership 2 configuration though).

    2. Go to "Membership 2 -> Memberships" page and note down IDs of all memberships (you'll find them when you hover cursor over membership name or click on "Show" link in "Shortcodes" column).

    3. Create an empty file named "m2-registration-complete-123.php", replacing "123" with an ID of one of the memberships.

    4. Put following code inside that file:

    <?php
    wp_redirect('YOUR_URL');
    ?>

    replacing YOUR_URL with an URL of a relevant "Thank You" page for this membership that you created in step 1.

    5. Upload the file to your current theme's folder (or better yet, create a child theme and put that file there).

    6. Repeat steps 3 to 5 for each membership

    you can find more in this thread:
    https://premium.wpmudev.org/forums/topic/membership2-custom-thank-you-pages

    Remember, always test in a stating website, if you can't do it, create a full backup.

    Have a great day
    Best Regards,
    Patrick Freitas

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.