WordPress Simple Membership After Login Redirect add-on shows you how to redirect your members to page when they log in and more.
Last Updated: June 23, 2023
Latest News: Updated the documentation.
The following instructions shows you how to set up an after login redirect landing page for your members. This is important if you want to create a special page with instructions for your members based on their membership level. There is also an option available that allows the members to be redirected to the page or post they are logging from.
Simple Membership After Login Redirection change log version 1.6
- Added an extra line debug logging output to show which page it is redirecting to. Useful for troubleshooting.
What You Need:
Note: The login redirect addon LOOKS for the special login link that the core plugin creates. It then replaces that login link with an extra parameter. If you use the custom messages addon to override the standard protection message of the plugin then the login addon can’t add the extra parameter. This is one of those features where you need to pick one (You can’t get both). Also, if you click on the Login Widget on the sidebar or the Login in your menu it will not redirect the member to the page or post they are visiting.
WordPress Simple Membership After Login Redirect Steps
Note: In Simple Membership version 3.2.5, a new feature was added to enable redirection to the last page after login (where they clicked the login link).
Step 1 ) Go to WP Membership -> Add-ons as illustrated in the image below to install Simple Membership After Login Redirection add-0n. Make sure you activate the add-on.
Step 2 ) Go to WP Membership -> Membership Levels. Check to make sure the After Login Redirection Page field is added to all your members level’s as illustrated in the image below.
Step 3 ) Create a new page, post or simply add the URL of the page you want the members to be redirected too. I created a new page and named it Free Membership Page. I made sure I protected the page and only allowed the members corresponding to this page. In this example only the Free Level members can have access to this page.
- Yes, Protect this content
- Free Level
Step 4 ) The following image shows you the URL address of the page added to After Login Redirection Page field. Make sure you click on Edit Membership Level button to save your changes.
When the members belonging to the Free Level membership level log in, they will be redirected to the page added to the membership level. In this example I added the following URL, http://localhost/wordpress361/free-members-page/.
Redirect To The Last Page
Step 5 ) If you want your members to return to the same page they landed on after they click on the login link, then make sure you enable the following feature Enable Redirect to Last Page. This is located in WP Membership -> Login Redirection -> Enable Redirect to Last Page as illustrated in the image below.
Step 6 ) The following image, displays a post with content protected and the Login link to log in. The members need to click on this link to view the content.
Step 6-a ) The following image, displays the protect content after the member has logged in. You can see that the member was not redirected to the URL added above in Step 4 ) because the feature Enable Redirect to Last Page is enabled.
Issue 1 ) Some have reported the following problem. When a user logs in and it is set to redirect to the previous page, the URL they are sent to excludes the ‘punctuation’ e.g. httpswww.mysite.org.ukmember-list. The “punctuation” has been converted to https%253A%252F%252Fwww.mysite.org.uk%252Fmember-list%252F. The %figures are then ignored in the redirect so “punctuation is removed”.
Issue 2 ) If you run into issues using this plugin/addon, you might like to read the following solution Back to page after login posted in the support forum.
Q1 I am also using Simple Membership Custom Message addon. How do I fix the redirect problem issue?
Answer 1: The redirection to the last page ONLY triggers if you click on the “Login” link from the protected content message that is shown inside a protected post/page. If you also have the following addon Simple Membership Custom Message installed and you alter the default message, the redirect to the last post will not get triggered and will not work. However you can try the following solution someone shared in the support forum.
Q2 The members are not redirected to the URL added in the membership level. How do I fix this issue.
Answer: Make sure the URL is not broken in other words when you enter the URL on the browser’s address you don’t get a 404 page not found error message. Also check your permalink structure, this can sometimes cause an issue.
Q3 I have a cache plugin installed in my site. How do I fix the redirecting issue in my site?
Answer: The membership functionality needs a dynamic page being shown to the members. A cached page simply shows a static cached page (our plugin doesn’t get a chance to apply the conditions to that page). When a cached page is being shown, the user is not actually being shown a page which can read the login status of the user then show/hide the page’s content accordingly. That’s what causes the issue with membership type setup because membership type site is not the same as a blog type site. Caching is normally fine with a Blog type site where there is no need to show content based on a member’s login status. Click the following link forum post to learn more.
We only support the following WordPress caching plugins at the moment:
That’s how simple it is to redirect the member to the last page or post they logged in if the option is enabled in the addon.
Click on the following URL Form Builder to continue.
If you have any questions please let me know. I will be updating this tutorial from time to time.
Simple Membership Plugin Tutorial List: