R&A | Use WPO365 Audiences to restrict / gate access to content

Require user-login to view content

Steps in this Topic

Introduction

WPO365 Audiences can be configured at the following two levels:

  • Page Level | Authors At page level, anyone who is allowed to edit the page can update the WPO365 Audiences configuration using the practical WordPress meta box.
  • Global Level | Administrators Administrators are able configure post type based rules that will globally restrict access to content.

Page Level | Authors

With the configuration to require user-login in place, a content creator can now edit a post or page in WordPress and – using the meta-box in the sidebar – mark it as private and thus limit access to the content to logged-in users.

Global Level | Administrators

Please perform the following steps, if you want to configure post type based rules that will globally require user-login to view content.

  • Go to WP Admin > WPO365 > User Registration and scroll down to the Audiences section.
  • Locate to the setting for Post types that require a logged-in user and select a post type that requires a user-login before content can be viewed. The below example demonstrates this for the custom post type intranet-post (slug for a custom post type created with PublishPress Capabilities).

Testing restricted access

Perform the following steps to test restricted / gated access for a page.

  • Ensure that you configured WPO365 Audiences as explained elsewhere on this page.
  • Create a new post that uses the post type for which you have defined restricted access.
  • Publish the page and copy the page’s URL.
  • To ensure that you are not logged in, start a new browser session as guest (or alternatively using the browser’s incognito mode).
  • Paste the URL in the browser’s address bar and check the response (see below).

You can change / translate the message “The page you requested requires you to sign in first.” when you go to WP Admin > WPO365 > … > Translations.