How to limit post views on WordPress
WordPress does not include a built-in post-view limit. You can build one with custom code that tracks visitors and resets their allowance, but a membership site is better served by a metered-access add-on that handles limits, periods, redirects and upgrade prompts.
- 01Choose the limit you need
- 02Understand the manual route
- 03Install the membership tools
- 04Set the view allowances
- 05Protect the right posts
- 06Test views and caching
What you need
- WordPress administrator access
- A clear view limit and reset period
- A membership level or protected content plan if views depend on membership
Choose the limit you need
Decide whether the limit applies to anonymous visitors, logged-in users, members, or all three. Then choose the number of views and the reset period, such as 3 posts per day or 10 posts per month.
Also decide what happens when the allowance runs out. Common choices are a redirect to a membership page, a login prompt, or an upgrade message below an excerpt.
Understand the manual route
WordPress cannot do metered post access on its own. A developer must create a small custom plugin that identifies the visitor, records views for the current period, checks the current post, and blocks or redirects the request after the allowance is used.
Use a custom plugin rather than editing the theme, because theme updates can remove the code. Cookie-based tracking is easy to build but easy to bypass by changing browsers, clearing cookies, using incognito mode, or switching devices. Logged-in tracking is more consistent, but it still needs careful handling for resets, caching, bots and shared accounts.
Install the membership tools
For the faster route, install and activate Paid Memberships Pro, then install its Limit Post Views Add On from Memberships > Add Ons. The add-on requires Paid Memberships Pro and is designed for metered access to protected posts.
If your site already uses another membership plugin, check whether it has a metered-content feature. Do not install two systems that both count views, or visitors may be blocked earlier than expected.
Set the view allowances
Open Memberships > Limit Post Views. Set the allowance for non-members, then add limits for individual membership levels if members should receive different allowances. Choose the period, such as an hour, day, week or month, and select the page used after the limit is reached. Save the settings.
Keep the limit modest while testing. A visitor usually sees a redirect only after the system has counted enough protected-post views, so a high test number makes it look as though the feature is not working.
Protect the right posts
Apply membership protection to the posts that should be metered. The add-on tracks the standard post post type by default. Pages and custom post types need additional configuration, including the documented post-type filter and, where required, the companion post-type restriction add-on.
Do not protect every post by accident. Leave the membership, pricing, login and upgrade pages accessible, or visitors may be redirected in a loop or have no page where they can join.
Test views and caching
Test as a logged-out visitor in a private browser window, then test each membership level in a separate account. Confirm that the counter increases only on protected posts, resets at the expected time, and sends the visitor to the correct page after the limit.
Check page caching, CDN caching and optimisation plugins before launch. A cached redirect or cached protected page can make different visitors share the same result. Also remember that the add-on uses cookies, so visitors can bypass the limit by changing browsers or devices; it is intended as a conversion prompt rather than high-security access control.
Let Paid Memberships Pro do it
Membership-level view limits and upgrade prompts for gated posts, ideal when you want metered content access rather than simple post protection.
Sources
- paidmembershipspro.com /add-ons/pmpro-limit-post-views/?utm_source=openai
Questions
- Can WordPress limit post views without a plugin?
- Not with WordPress settings alone. You need custom code that records each visitor's views, applies a time window, and decides what to show after the allowance is used. A custom plugin is safer than editing a theme, but cookie tracking can be bypassed and logged-in tracking needs more development work.
- Is limiting post views the same as counting post views?
- No. A view counter records how often content was viewed, while a view limit controls whether someone may view more content. Analytics and counter plugins usually do not enforce membership allowances, reset periods, redirects or upgrade prompts.
- Can I give different members different post-view limits?
- Yes, provided your membership system supports metered access by level. Paid Memberships Pro's Limit Post Views Add On lets you configure limits for non-members and individual membership levels, with a selectable reset period.
- Can I limit pages or custom post types too?
- Not by default with the Paid Memberships Pro add-on, which tracks the standard post type. Pages and custom post types require additional configuration using its documented post-type filter, and some setups also require the companion post-type restriction add-on.
- Can visitors bypass a cookie-based post-view limit?
- Yes. Cookie-based metering can be bypassed by clearing cookies, using another browser, opening a private window, or changing devices. That makes it suitable for encouraging membership sign-ups, but not for enforcing strict entitlement or preventing determined users from accessing content.