How to Conditionally Redirect WordPress Users After Login

Searching for ways to redirect WordPress users after they log in? Then, you have landed at the right place. Users are redirected to particular pages to take further actions in the membership sites, learning management systems and eCommerce stores. For example, an eCommerce website redirects the users to their profile to encourage them to fill up the details. Of course, the sites using the membership or eCommerce plugin already have a redirect option.
If the plugins do not provide you with the redirection option or you do not use the eCommerce or membership sites, do not worry. Here the blog will give you the guide to redirect users after Login with the LoginWP plugin.

Redirecting WordPress Users After Logins

You must know that you need to determine on what basis and where you want to redirect the users. Whether you will turn them based on their capabilities and roles, like a profile page, feedback forms etc. After ensuring all these things get started with the steps.

⦁ Creating a Custom User Profile Page

To create a custom user profile page like a product update page, you must download and activate a user profile plugin of WordPress like ProfilePress. After that, visit the forms and profiles section of the Profile Press as shown on the WordPress dashboard. Next, Click on Add New, and select the User Profile option.
Now write your name on the box, select the preferred template and then move forward to create the user profile. To preview the user profile, press Live Preview. Further, make the new page the default profile page.
Go to the settings option of Profile Press and click on Frontend Profile Settings. Next, find the option Page with Profile Shortcode, and click on it. Now select the page you created and save the changes you made. Now, you are done.
Now, as you have successfully created your custom page, let’s design a custom redirect function for users who sign in to your WordPress site.

⦁ Redirect Users After they log in

It’s time to redirect all users, specific users, users who have enrolled in the membership and course, and the users with specific capabilities and roles. Let’s get started!

Go on the LoginWP, then click on Redirections and Redirection Rules. After that, Under Rule Condition, Choose the Username and specific user name you will redirect. Now, link a URL in the Login URL section. As the users sign in to the WordPress website, they will be redirected to the profile access.
However, if you want to redirect them to the profiles, you should use the View Available Placeholder to define where the users should turn or redirect. Below is the list of available placeholders you can choose to redirect the users.

⦁ Website URL: {{website_url}}
⦁ A page’s URL, a user, was on before redirection to the sign-in page: {{previous_page}}
⦁ User nicename or Author URL slug: {{user_slug}}
⦁ Page’s URL, a user is logging in from: {{current_page}}
⦁ Username of user: {{username}}
⦁ Suppose you wish to redirect the user where they are logging from. Insert {{current_page}} in the Login URL field, and you will be done

⦁ Login Redirect by User Role in WordPres

Go to LoginWp, Click on Redirections, and then press Redirection Rules to redirect your users based on their roles. Select the User roles and User role under the Rule Condition to proceed further.
Next, you will see an Order option given on the screen. It becomes accessible in situations when a user is both a customer and a subscriber. As the rules for customers and subscribers differ, they often get confused about which direction they should follow while trying to log in.
With the help of the Order option, you can define which rule to implement in the plugin. First, a minor number rule will be implemented, i.e., 1. Now, go to the Login URL section and add the URL.

⦁ Redirecting Users Enrolled in the Membership or Course 

If you provide a course on the WordPress website, then you should use a LifterLMS course plugin. The bright side of this plugin is its easy access to LoginWP, which lets you turn the users to the course page. Some of the plugins with which LoginWP integrates are MemberMouse, Theme My Login, Restrict Content Pro, Profile Press, WP User Frontend, WP User Manager, Easy Digital Downloads, Lifter LMS, WooCommerce, etc.
Out of all these, LifterLMS seems to be the most trustable plugin among users. The integration of LoginWP with LifterLMS helps you redirect the users or students based on membership or course they are enrolled in after they sign in to the website. Now follow the steps to ensure the plugin integrates with LoginW well.
Go to LoginWP, Press on Redirections and then enable LifterLMS integration to redirect the students or website users enrolled for a specific course.
Further, navigate to the Redirection Rules and choose Enrolled Course.
However, if you need to redirect the students or learners based on membership, choose Enrolled Membership as the rule condition.
Look at the right side of the screen, where your course offered will display. Choose the course you will redirect. Now in the next module, insert the login details and sign-out URL of the page where you will turn the users who have signed up for the course. Do not miss out to press on the Save Rule button last.

What’s your Biggest wordpress redirecting Challenge Right Now?

Let’s Talk


⦁ Redirect Users based on Capabilities in WordPress 

To redirect the users based on their capabilities, follow the steps-
Go to LoginWp and click on Redirections and then Press on Redirection Rules. After that, press User Capability and select the capability under the Rule Condition option. Further, Click on the Login URL section and add the desired URL. Last, save the rule. Now users will be redirected as per their capabilities.

⦁ Redirecting All Other Users in WordPress Website 

To redirect the users who are not influenced by the redirection rules, move towards the All Other Users option and insert the login and logout URLs.
Having discussed all these aspects, the redirection of WordPress users after they log in has ended. Now all you need to do is save all the changes and settings, and you are done

  • Wrapping Up!

Custom or conditional redirection is the best way to define the steps for users. It can result in a seamless user experience and consequently improve user trust and loyalty. Anyone owning an eCommerce platform or running a membership website should app the conditional redirection on the site. This is all the blog has brought you. Hope! The guide has been helpful for you.


Picture of Vishavjeet Choubey

Vishavjeet Choubey

Recent Posts