With Restrict for WordPress and WooCommerce, you can set up time based content restriction on any page or post: a customer purchases a specific product and gains access to your content for a set number of days, hours and minutes after the purchase – after which access expires automatically. This tutorial explains how the feature works, how to configure it step by step, and when to choose it over a full subscription setup.
This option was added in version 2.1.2 of Restrict, due to popular demand, and it has since become one of the most used features of the WooCommerce integration.
Why time based content restriction?
A one-time purchase normally grants access forever. That is fine for many products, but plenty of business models need an expiry date: online classes sold as a 30-day pass, workshop replays available for a week, premium reports accessible for a limited period, or trial-style access to member content. Time based content restriction covers all of these with plain WooCommerce products – no subscription plugin, no recurring billing, no extra add-ons.
What you need
- Restrict for WordPress version 2.1.2 or newer (see plans and pricing).
- WooCommerce with at least one payment gateway configured.
- Customer accounts enabled: customers must purchase as registered, logged-in users so Restrict can match purchases to visitors. In WooCommerce Settings -> Accounts & Privacy, uncheck Allow customers to place orders without an account. The WooCommerce integration guide covers this in detail.
Example: a 30-day online class
Let’s say you are selling online classes on your website and want customers to access the class content only if they purchased a specific WooCommerce product – and only for one month after the purchase. Here is how to set that up:
- Create a page or post whose content is your class.
- In the Content available to dropdown menu, choose the WooCommerce criteria and select Specific product, then pick the required product.
- You will notice two additional options labeled Duration: Indefinitely and Limited time after purchase.
- Select Limited time after purchase and set the number of days, hours and minutes. For a one-month pass, set 30 days.
- Publish the page – you are done.

The Indefinitely option is self-explanatory – it applies no time limit at all, and the customer keeps access for as long as they have an account. Limited time after purchase is where things get interesting: the countdown starts from the moment of purchase, and once the configured time runs out, the customer can no longer view the restricted content.
In our example, the content is available to each customer for exactly 30 days after they purchase the required product. Because the timer is tied to each individual purchase, every customer gets their own full access window regardless of when they buy.
Beyond pages and posts
The example above covers the most common scenario – restricting a single page or post – but the same time-based criteria can be applied elsewhere too:
- Post categories: restrict a whole category with the same rule. This is particularly useful when you want a number of posts – say, all lessons of one course – to share the same time-based restriction without configuring each post separately. See restricting access to post categories.
- Widgets: show a widget only to customers whose access window is still active.
- Menu items: display navigation links to the restricted content only to users who can currently access it, keeping your menus clean for everyone else.
Tell expired customers what happened
When a customer’s access time runs out, you do not want them staring at a generic block screen wondering if something broke. In the WooCommerce tab of Restrict settings you can define a custom message for exactly this case – Specific product (limited time) – shown to customers who purchased the required product but whose access period has expired.
Use it to explain that access has ended and point them to where they can purchase access again. Clear messaging turns an expiry into a repeat-sale opportunity instead of a support ticket. All available messages and placeholders are described in the WooCommerce integration documentation.
Time-based access vs. subscriptions
Both approaches limit how long customers keep access, so which should you use?
- Time-based restriction (this guide) is a one-time purchase with a fixed access window. It is simple, needs no paid add-ons beyond Restrict, and suits passes, rentals and limited-time offers. When time runs out, the customer decides whether to buy again.
- Subscription-based restriction keeps access tied to an active, automatically renewing subscription. It requires the WooCommerce Subscriptions add-on, but renewals happen on their own, making it better for ongoing memberships. That setup is explained in content restriction based on the WooCommerce Subscriptions plugin.
A good rule of thumb: if you want customers to actively choose each renewal, go time-based; if you want recurring revenue with automatic billing, go subscriptions.
Real-world example
For a complete, practical build using exactly this feature – a website selling access to video classes for 30 days after purchase – check out our use case on selling online yoga classes with Restrict and WooCommerce. The same recipe works for any kind of class, course or premium content; the general approach is covered in selling online courses on your website.
Conclusion
Setting up time based content restriction with Restrict and WooCommerce takes only a few minutes: create the product, restrict the content to buyers of that specific product, and set the duration. It is an effective solution for a broad range of scenarios – and if you ever outgrow it and need automatic renewals for continuous paid access, the subscription-based setup linked above is the natural next step.