In this code recipe, we showcase two code-based methods to set up login redirection for your membership site.
The firsts recipe shows you how to change the default login behavior in PMPro to send all members to the same landing page. The second shows you how to send different users to different landing pages based on level.
If you aren’t comfortable using code, check out the Member Homepages Add On for a more user-friendly method to set up redirects. We talk about all these methods, the benefits of login redirection, and a few other ways to set up redirects in our guide on How to Redirect Members on Login and Why You Should.
This recipe will show you how to redirect all members, regardless of their level, to a specific page after logging in.
Tweak this code to your needs by changing the $redirect_to URL on line 18.
Code Recipe #2: Login Redirects Based On Membership Level
This recipe will show you how to redirect members to a specific page based on their membership level after logging in.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Jason Coleman is the co-founder and CEO of Paid Memberships Pro, the most trusted membership platform that grows with you. With a deep passion for open source software, Jason is the author of Building Web Apps With WordPress, published by O'Reilly Media.
Jason's entrepreneurial spirit is driven by uncertainty, risk, and the thrill of new opportunities. With over two decades of experience in development, management, and marketing, he is committed to Paid Memberships Pro: the only open source platform focused on helping creators get paid so they can find freedom in their life and fulfill their goals.
Free Course: Membership Site Development—The Basics
Develop a deeper understanding of membership site development in this beginner-level course. Learn how to make your site work better, save yourself time and money, and improve your site's performance.
Please accept terms and conditions to proceed. You can access the terms
here.
Ensure you are in a private space where you can discuss your personal health information before starting the consultation.