Support » Fixing WordPress » Restricting site access

  • Hi guys,

    we’re building a closed community website. The idea is that a non loged in / registered user can access: landing page, login and register pages and that’s it.

    Other content is off limits. If they try to access any of the urls directly, they get redirected to landing page.

    Has anyone tried to do this and how did you do it?

Viewing 2 replies - 1 through 2 (of 2 total)
  • Yes. There are numerous plugins that will help you create a members-only site and restrict access.

    A simple conditional statement could be right up your street, something such as the following could detect whether a users logged in and checks the page they’re on.

    <?php if (is_user_logged_in() && is_page('home')) { /* Do things here */ } ?>

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restricting site access’ is closed to new replies.