---
title: Restrict content with Access Rules
description: Use Access Rules to lock a whole post type, every post in a category, single files, an exact URL or every URL that contains a keyword, for the member types you choose.
url: "https://ultimatemembershippro.com/docs/how-to-restrict-any-page-or-group-of-pages/"
updated: "2026-10-18"
category: Content Restriction
tags:
  - all pages
  - any page
  - block
  - restrict
  - url
  - url block
---

# Restrict content with Access Rules

5 minIntermediateUltimate Membership Pro 14.2+

The Locker in the editor restricts one page at a time. Ultimate Membership Pro Access Rules [restrict many at once](https://ultimatemembershippro.com/features/content-restriction/): every post of a type, every post in a category, [media files](https://ultimatemembershippro.com/docs/download-monitor-integration/), or any URL on your site. New content that matches a rule is locked automatically.

This guide explains the five rule types, then creates one rule that keeps a Premium category for paying members.

Before you start

- You have at least one Membership. See [Create your first Membership](https://ultimatemembershippro.com/docs/step-2-create-levelssubscriptions/).
- For a single page, the Locker is simpler: [Restrict your first page](https://ultimatemembershippro.com/docs/step-3-restrict-pagescontent/).

## Pick the rule type

Go to Ultimate Membership Pro*›*Access Rules. The screen has one tab per rule type:

[![Content Access Rules header with the tabs All Posts, All Posts based on Categories, Specific Files, Entire URL and All Pages (based on Keywords)](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-01-access-rules-tabs.png)](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-01-access-rules-tabs.png)
The five rule types. The highlighted tab is the one used in the example.

All Posts

**Locks**
: Every item of one post type

**Good for**
: Courses, lessons, products

All Posts based on Categories

**Locks**
: Every post in one category

**Good for**
: A Premium or Members category

Specific Files

**Locks**
: One media file, by its link

**Good for**
: PDFs, videos, ZIP downloads

Entire URL

**Locks**
: One exact URL

**Good for**
: Archive pages, pages built by other plugins

All Pages (based on Keywords)

**Locks**
: Every URL that contains a word

**Good for**
: A whole section, such as /academy/

## Fill in the rule

Open the tab you need. The form is on the left. Every rule type has the same three settings at the bottom; only the first field changes.

[![Block All Posts By Category Name form with Category Premium, Show Only for, Target Members Pro Monthly and Annual Pass, Redirect After Subscription Plan](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-02-category-rule-form.png)](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-02-category-rule-form.png)
A category rule for the example. The numbers match the list below.

 1What to restrict

Depends on the tab:

- **All Posts**: **Custom Post Type**, any post type registered on your site.
- **All Posts based on Categories**: **Category**. Works for any post type that uses that category, including products.
- **Specific Files**: **Full File Link**, the full link of a file in your Media Library.
- **Entire URL**: the full link, copied from your browser.
- **All Pages (based on Keywords)**: **Keyword**, a word that appears in the links you want to lock.

2ExcludingAll Posts, Categories

Post IDs that the rule skips, separated by commas, for example `30, 55, 102`.

3Restriction type

**Show Only for...** lets only the Target Members in. **Block Only for...** keeps only the Target Members out.

Default: **Show Only for...**

4Target MembersRequired

Pick from the drop-down to add a tag; add as many as you need. Choose All, Registered Users, Unregistered Users or a Membership. Only members whose Membership is active count.

5Redirect After

Where people who can't see the content are sent. Pick a page (custom links from the [Redirect Links module](https://ultimatemembershippro.com/docs/can-i-use-external-links-for-redirect/) are listed too). If you leave it on …, they're sent to your homepage.

## Add the rule

Click Add New Access Rule. The rule shows up in the list on the right of the same tab, and the counter at the top counts it.

[![Rules list with one rule: Target Category Name Premium, Restriction Type Show, Target Members pro_monthly and annual_pass, Redirect After Subscription Plan](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-03-category-rule-list.png)](https://ultimatemembershippro.com/wp-content/uploads/2026/10/ump-access-rules-03-category-rule-list.png)
The saved rule. Target Members shows each Membership by its slug.

1. To change a rule, remove it and add it again with the new settings.
2. To remove rules, click the trash icon, or tick several and use **Bulk Actions** › **Remove**.

## Test it

Open a matching post in a private browser window, then log in as a test member who has one of the Target Memberships. Administrators always see everything, so don't test while logged in as admin.

Good to know

- **Entire URL** matches the exact link, including `https://`, `www` and the trailing slash. Copy it from the address bar.
- Adding an Entire URL or Keyword rule for a link that already has a rule replaces the old rule.
- **Specific Files** works by writing a rewrite rule into your site's `.htaccess` file, for mp3, mp4, avi, pdf, zip, rar, doc, docx, gz, tar, xls and xlsx files. The server must use [Apache with mod_rewrite](https://httpd.apache.org/docs/current/mod/mod_rewrite.html) and the file must be writable. On Nginx the rule has no effect.
- A category rule locks the posts, not the category archive page. To lock the archive, add an Entire URL rule for it.
- Links that contain ultimate-membership-pro are never restricted, so the plugin's own pages always work.

Lock the whole site

To keep every page behind a login, go to Ultimate Membership Pro*›*Settings*›*Security and switch on **Restrict access over entire Website**. All pages except the homepage and the plugin's pages (Login, Register and so on) are restricted, and visitors are sent to the Login page. List pages that stay open in **Exclude other pages from current Restriction**, as IDs separated by commas.

## Example: a Premium category

 **Premium articles**Every post in the Premium category is for paying members. Everyone else lands on the plans page.

**Tab**
: All Posts based on Categories

**Category**
: Premium

**Excluding**
: Empty

**Restriction type**
: Show Only for...

**Target Members**
: Pro Monthly, Annual Pass

**Redirect After**
: Subscription Plan

## Troubleshooting

  “Please complete this field” under Target Members

A rule needs at least one member type. Pick one from the Target Members drop-down.

  The rule doesn't do anything

You're probably logged in as an administrator. Test in a private window or with a test member.

  An Entire URL rule doesn't match

Compare the saved link with the address bar character by character: http or https, www, trailing slash, query string.

  Files can still be downloaded

Check that your server is Apache, that .htaccess is writable and contains the Ultimate Membership Pro Rules block, and that the extension is in the supported list.

  Blocked visitors land on the homepage

**Redirect After** is empty. Edit the rule (remove and add it again) and pick a page.

## What's next

 [**Hide part of a page**Lock a section instead of a page.](https://ultimatemembershippro.com/docs/how-to-set-an-inside-locker/)[**Release content over time**Unlock lessons day by day.](https://ultimatemembershippro.com/docs/drip-content-main-settings/)[**Limit post views per Membership**Cap reads, posts and comments per plan.](https://ultimatemembershippro.com/docs/wp-workflow-restrictions/)[**Restricted content is visible to everyone**What to check when a rule seems ignored.](https://ultimatemembershippro.com/docs/set-up-private-content-but-everything-is-public/)
