Skip to content
memberarea memberarea.io

Locking a page to members or a course

Protect a whole page, or single blocks inside it, and choose what visitors without access see.

In this article

The plugin can protect a whole page or single blocks inside it. Both rules are checked on your server before anything is sent, so protected text never reaches a browser that may not see it.

Lock a whole page

  1. Open the page in the block editor.
  2. In the Page tab of the sidebar, open the MemberArea access panel.
  3. Under Who may read this, pick one of: Everyone (the default), Signed-in members, Visitors who are not signed in, Members with a course, Members in a group or Members who bought a product.
  4. For the last three, a second field named Which one appears. Pick the course, group or product there. If the list cannot be loaded, the panel says so; check the connection on the settings page.
  5. Under Visitors without access, choose what happens:
    • See a short message instead, with your own wording in Message if you like.
    • Are sent to the sign-in, which takes visitors who are not signed in to your memberarea and brings them back to the page afterwards. Signed-in members without access see the message instead, and so does everybody while member login is not set up.
    • Are sent to another page, for example your sales page. Enter it under Send them to.
Warning

If you leave Which one unset, the rule falls back to plain members-only: every signed-in member may read the page, whether or not they hold the course. The panel warns you about this, but the page still saves.

The MemberArea access panel with a course rule and a message for visitors
The MemberArea access panel with a course rule and a message for visitors

Where "Send them to" may point

The target has to be a page on this site: a path that starts with /, or a full address on this site's domain. Any other address, including your memberarea, is ignored, and the visitor sees the short message instead. Use a page here, and let that page link onwards.

  • If WordPress runs in a subfolder, such as example.com/blog, enter the full address. A path like /offer/ leads to the root of the domain, not into the subfolder.
  • A target that is the locked page itself is ignored, and the visitor gets the message.
  • Do not let two locked pages send visitors to each other. The plugin does not catch that loop.

Hide a page from members who are already signed in

Visitors who are not signed in turns the rule around: the page is open to strangers and closed to everybody who is signed in. Use it for a sign-up page, a free trial offer or a sales page that a paying member should never land on.

Because everybody this rule refuses is signed in already, Are sent to the sign-in is not offered for it, and the notice carries no Sign in button. The two remaining answers are a short message or a redirect, for example to the member dashboard.

Where the rule applies

The rule applies to the page everywhere it appears: the page itself, its excerpt, archive listings, search results, query loops, the sitemap and the REST API. With the message answer, the page stays in archive listings with the message as its excerpt. With the sign-in or redirect answer, it drops out of listings and the sitemap. Search results never show a locked page to a visitor without access.

Comments on a locked page are hidden and closed for everyone without access, in the theme, the REST API and the comment feeds. Members with access read and write comments as usual.

Setting a rule needs the block editor, but an existing rule keeps working whatever editor you use afterwards.

Lock single blocks

Any block can be shown to a subset of visitors. Select the block, open the Block tab in the sidebar, and expand MemberArea visibility. Under Show this block to, pick everyone, signed-in members, visitors who are not signed in, or holders of one course, group or product.

The MemberArea visibility panel of a block, set to visitors who are not signed in
The MemberArea visibility panel of a block, set to visitors who are not signed in

This is how you build one page that reads differently for buyers and for strangers: a sales section for guests, the real content for members.

What a visitor sees

On a locked page, a visitor who is not signed in sees your message and, once member login is set up, a Sign in button. Without your own wording, the message says the page is for members and asks them to sign in. A signed-in member who lacks the right course, group or product sees the message with no button, because signing in again would not help. Without your own wording, they read that the page is reserved for members with the right access.

A locked page as a visitor sees it: your message and a Sign in button
A locked page as a visitor sees it: your message and a Sign in button

Your own message is shown to both, so word it for both: a stranger and a member who has not bought this course yet.

On a page reserved for visitors who are not signed in, a signed-in member reads your message, or that the page is not for them, again without a button.

A hidden block shows nothing at all, so a visitor cannot tell that something is there.

If your memberarea cannot be reached at that moment, a rule for a course, group or product keeps the content closed. A signed-in member then reads that their membership could not be checked and is asked to reload in a moment. This appears in place of a locked page, and in place of a hidden block. A redirect is skipped in that moment, so a member is never sent to a sales page for something they own.

Caching

Pages stay cacheable for anonymous visitors and carry a header that tells shared caches to keep member and guest copies apart. As soon as a visitor is signed in, responses are marked not to be cached, including for the common cache plugins that honour DONOTCACHEPAGE.

Caution

A page cache that ignores those headers can serve a signed-in member's copy of a page to a stranger. If you use one, check that it honours Vary: Cookie and DONOTCACHEPAGE before you rely on locked pages.

Last updated on October 25, 2026

Was this article helpful?

Related articles