Membership Plugin

WordPress Membership Plugin

  • Home
  • Documentation
  • Addons
  • Support
    • Quick Setup
    • Documentation
    • Premium Addon Support
    • Paid Support
    • Support Forum
    • Support Forum Search
    • Forum Login
    • Forum Registration
  • Contact

Redirect not logged in users to login page with both the login and registration

Simple Membership Plugin › Forums › Simple Membership Plugin › Redirect not logged in users to login page with both the login and registration

Tagged: redirect

  • This topic has 16 replies, 2 voices, and was last updated 9 years, 10 months ago by Stefan.
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
  • Author
    Posts
  • January 26, 2017 at 9:37 pm #9873
    Stefan
    Participant

    I want to redirect all users before the login to a page with both the login and registration forms side-by-side. I don’t want them to go to the page that says “You need to login to view this content. Please Login. Not a Member? Join Us.” I want them to automatically go to a page that has the 2 forms side-by-side. How do I do the auto redirect? I found code on this page, but it crashed the website. https://simple-membership-plugin.com/auto-redirect-non-logged-in-users-protect-whole-site/

    January 26, 2017 at 9:44 pm #9875
    mbrsolution
    Moderator

    Hi, are you wanting to protect the whole site? The link you shared above is meant for a site that is totally protected.

    January 26, 2017 at 11:12 pm #9878
    Stefan
    Participant

    Yes. I want to protect the whole site. I want the page to look like this when someone tries to get to any page when they’re NOT logged in. https://printing4liberty.com/customer/account/login/ Once they’re logged in, I want them to be able to go to any page.

    Thanks

    January 26, 2017 at 11:18 pm #9880
    mbrsolution
    Moderator

    Okay, no problem. When you say it crashed your whole site, did you see any error messages? Can you carry out the following troubleshooting steps.

    Thank you

    January 26, 2017 at 11:23 pm #9882
    Stefan
    Participant

    The membership plugin is working. It only crashed when I put in the PHP code I found on https://simple-membership-plugin.com/auto-redirect-non-logged-in-users-protect-whole-site/. Now, I just need to know how to redirect all users, BEFORE they login, to a page that has both the login and registration forms side-by-side. I want to skip the page with the notice, “You need to login to view this content. Please Login. Not a Member? Join Us.” I want it to automatically go to the page with the side-by-side registration and login.

    Thanks

    January 26, 2017 at 11:34 pm #9883
    mbrsolution
    Moderator

    Okay no problem. I think the following documentation should do the trick.

    Regards

    January 26, 2017 at 11:39 pm #9884
    Stefan
    Participant

    This link is about adding members manually. That’s not what I need. For a non-logged in person, I want the page to look like this. https://printing4liberty.com/customer/account/login/

    Thanks

    January 26, 2017 at 11:48 pm #9885
    mbrsolution
    Moderator

    The link I shared above is for adding a member manually but it also shares information about hiding or removing all links and URLs from your site, which is what you are also trying to achieve. In regards to pointing a non member to a specific page did you change the URL in the code above?

    January 26, 2017 at 11:50 pm #9886
    Stefan
    Participant

    Which code above?

    January 26, 2017 at 11:54 pm #9887
    mbrsolution
    Moderator

    You need to change the URL in the following code https://simple-membership-plugin.com/auto-redirect-non-logged-in-users-protect-whole-site/.

    wp_redirect( ‘http://www.your-domain.com/membership-login&#8217; ); <== this URL needs to point to the page or post you want to redirect the non members too.

    January 27, 2017 at 12:06 am #9893
    Stefan
    Participant

    I did that, and that’s when I got the error. I added it to the bottom of the function.php. I had to restore using my backup. Where in the plugin does it direct non-logged in users to the page showing the message “You need to login to view this content. Please Login. Not a Member? Join Us.”?

    Thanks

    January 27, 2017 at 12:21 am #9895
    mbrsolution
    Moderator

    That is the page you need to change using the instructions I provide above in the documentation. That is why I shared that link. It helps you to change, hide and remove links. Especially the following.

    “You need to login to view this content. Please Login. Not a Member? Join Us.”?

    Did you read the last part of the redirect code. This is what it says.

    You will need to change the redirection URL to the actual login page URL of your site.

    The non logged-in users are only allowed to access the membership login and join us pages in the above example.

    January 27, 2017 at 12:40 am #9898
    Stefan
    Participant

    You are referring to the actual WordPress url login for my site?

    January 27, 2017 at 12:43 am #9900
    mbrsolution
    Moderator

    Yes that is correct.

    January 27, 2017 at 12:51 am #9901
    Stefan
    Participant

    Never done that. The link gives me all the instructions?

  • Author
    Posts
Viewing 15 posts - 1 through 15 (of 17 total)
1 2 →
  • You must be logged in to reply to this topic.
Log In

Please read this message before using our plugin.

Search

Featured Addons and Extensions

  • Membership Form Builder Addon
  • Member Directory Listing Addon
  • WooCommerce Payment Integration
  • Member Data Exporter Addon

Documentation

  • Documentation Index Page

Copyright © 2026 | Simple Membership Plugin | Privacy Policy