Support » Plugin: Restricted Site Access » Restricted Site Access But Allow WP REST API Access

  • I want my WordPress Users to login to view the site. Where this plugin greatly helps. But I have an app which uses this site’s REST API to fetch posts. Using this Plugin restricts that api too. I don’t want my app users to register to this site for viewing posts. But want to restrict direct website visitors. Is it possible with this plugin?
    Waiting for help. It will be highly appreciated. Thank you in advance.

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Author Helen Hou-Sandi


    4.0 and 4.7 Release Lead

    It is possible right now on the code level, there’s an example on GitHub:

    I am open to discussing a UI option for this but my current thought is that it defeats the purpose of the plugin, as opening up the REST API actually does make your site essentially available and possibly in ways that a less technical user might not expect nor appreciate when they go to change the option because another app is asking for unauthenticated access.

    In the case of your app, I would suggest you look into authenticating requests, not in a way that requires specific user registration, but using tokens or similar.

    Thank you for your response.

    The github code level solution is not working. If you help me even with the code level I would highly appreciate it.
    I have changed the WP REST API default url to something else to hide direct user access. I think that is enough for my purpose.
    I just don’t want direct non-user visitors to see my wordpress site’s posts. I want them to install the app to see those.
    I am not that much advance to use my app with auth.
    Thank you.

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Restricted Site Access But Allow WP REST API Access’ is closed to new replies.