Page Restrict for WooCommerce


Page Restrict for WooCommerce is a plugin that sells access to pages, posts and custom post types through WooCommerce. It’s been built with Gutenberg in mind as well as the classic editor. You can restrict pages in two ways. Restrict an entire page or restrict sections on the page. In case you want to restrict sections on the page you can use blocks for the Gutenberg editor and using shortcodes for the classic or similar editors. If you want to restrict entire pages you can use enable the sidebar in the More tools & options in the Gutenberg editor or use the page metabox in the classic editor. You can also restrict all of your pages in one place in the Pages plugin menu.


  • WooCommerce to be installed and active
  • Guest checkout needs to be disabled
  • PHP 7.0.25+.


  • Restrict content from pages, posts and custom post types based on if they have purchased a specific WooCommerce product
  • Restrict entire page or just sections of it
  • Use one or multiple products to restrict it and choose whether you want to require the user to buy all of them to access or at least one of the products that restrict.
  • Restrict by time – Set a time limit for the user after which they won’t be able to see the content.
  • Restrict by views – Set a view count for the user after which they won’t be able to see the content ( currently only if you want to restrict entire pages ).
  • Use other pages or posts for specific pages as Restricted Messages
  • Use default pages or posts for all restricted pages as Restricted Messages
  • Redirect to the chosen page instead of just showing the other pages content
  • Built for use with the latest Gutenberg editor as well as the classic one
  • Use either Gutenberg blocks or shortcodes to restrict sections on a page or post
  • Plugin menu page to handle all pages you need to restrict in one place called Pages
  • Plugin menu page to get an overview of all users that bought a product required to access an restricted page which either is still valid or already expired called User Overview.
  • Similar feature to User Overview for the frontend for each user to have an overview of their pages where they bought products in order to access them.
  • A Quick Start menu page to get you started on using this plugin


Section Restrict for WooCommerce – Restricts a section on the page using this grouping element.

Restricted Pages List – Shows a table of restricted pages for the current user which have had bought products for.


[prwc_is_purchased products=”1,2″ days=”25″ hours=”2″ minutes=”45″ seconds=”15″ inverse=”false” defRestrictMessage=”Restrict Message” notAllProductsRequired=”false” defaultPageNotBoughtSections=”4″ defaultPageNotLoggedSections=”5″]

  • Restricts the content using the chosen options.
  • products – choose which products to restrict with. Add product IDs separated by a comma.
  • Timeout options for this are days, hours, minutes, seconds.
  • inverse – using the inverse option you can choose inverse=”false” to hide the content in order for the user to not see it. Choose inverse=”true” for the user to see it in order to show them instructions on what to do to access the desired content you chose using inverse=”false”
  • defRestrictMessage – is the message you want to show if the user didn’t buy the product.
  • notAllProductsRequired – set to true if the user doesn’t need to buy all products.
  • defaultPageNotBoughtSections – you can choose a page to show instead of a message like in defRestrictMessage.
  • defaultPageNotLoggedSections – you can choose a page to show if the user isn’t logged in.

[prwc_restricted_pages_list table=”time” disable_table_class=”false”]

  • Shows a table of restricted pages for the current user which have had bought products for.
  • Using the table attribute you can choose which table of restricted page you will show. It can show pages that are restricted either by time or view count.
  • Using disable_table_class attribute you can choose whether to kepp or not to keep the default plugin style for the tables.
  • You can show restricted pages that timeout either by time or view.

Coming soon

  • Restrict categories
  • Restrict authors


  • Plugin pages menu page
  • Plugin user overview menu page
  • My account user overview page
  • Plugin quick start menu page
  • Gutenberg sidebar – Products – Restrict with
  • Gutenberg sidebar – Page to Show – Restrict message pages
  • Gutenberg sidebar – Timeout – Time until restriction expires
  • Gutenberg block
  • Gutenberg block – General block settings
  • Gutenberg block – Products – Restrict with
  • Gutenberg block – Timeout – Time until restriction expires
  • Classic metabox
  • Plugin settings


This plugin provides 2 blocks.

  • Restrict Section for WooCommerce
  • Restricted Pages List


  1. Upload the plugin files to the “/wp-content/plugins/page-restrict-for-woocommerce” directory, or install the plugin through the WordPress plugins screen directly.
  2. Activate the plugin through the “Plugins” screen in WordPress
  3. Use the Settings –> Page Restrict screen to configure the plugin
  4. You can go to Settings –> Page Restrict –> Quick Start to get a head start on how to use this plugin


Do you have a premium version of the plugin?

No, there isn’t any.


Saratan 15, 2024
The plugin is very promising. I expect great future for it. However, I am facing a bit of quirky behavior, would be great if it can be solved. using, when using this plugin, I notice some strange cache where actions don’t reflect immediately or sometimes don’t reflect at all unless another change happens. For eexample, adding woocommerce product doesn’t show immediately in the list of the products for the plugin, also newly created pages and posts don’t show in the plugin settings’ dropdowns. Also using the inverse block, shows different inconsistent behavior. I ddisabled edge cache of but still the quirky behavior is happening. Would bbe great to have some help on that
Hamal 12, 2024
This plugin does not work. It throws constant errors relating to customer log out. I reached out to the devs over 6 months ago with initial request for support and even until this date, despite a number of further requests for an update, we are no further forward. We have removed the plugin now as its started to cause other problems with the latest affecting basket contents showing for mobile users and pages crashing. Woocommerce is also now saying it is incompatible, so it had to go and since uninstalling the page restrict for woocommerce plugin, we have not had a single problem! Shame really as the plugin has the potential to be quite good, but the support or rather lack of it (plugin was last officially updated 8 months ago) renders the plugin useless.
Hamal 3, 2024
Dude, you did an ABSOLUTELY AMAZING JOB with this plugin. I created an account here especially to tell you this.I checked all the similar plugins and, beside the fact that they are obscenely over-complicated just to get cash from the customers, they have so many gaps and enforced procedures that drives you crazy. Your plugin works perfectly, it does exactly what it should do. Thank you! Really, THANK YOU!I really want to donate you something, so please let me know where and how.
Miyzan 5, 2023
I was looking for a plugin to sell content from my website. Tried several other options, but this one works the best and the easiest. I always bypassed WooCommerce because I thought it would slow down my website drastically. That’s not the case. Thank you, Vlado Grcic!
Súmbile 10, 2023
Beautiful! I was using a code before which was not working as I want and I stumbled on this plugin, which is a life saver. Thank you
Hamal 24, 2023
First plugin I ever rated. I dont even use it anymoe but it sure does work well
Read all 16 reviews

Contributors & Developers

“Page Restrict for WooCommerce” is open source software. The following people have contributed to this plugin.


“Page Restrict for WooCommerce” has been translated into 1 locale. Thank you to the translators for their contributions.

Translate “Page Restrict for WooCommerce” into your language.

Interested in development?

Browse the code, check out the SVN repository, or subscribe to the development log by RSS.



  • Fixed sidebar not loading.
  • Update class-front.php.
  • Fixed WC “High-Performance Order Storage (HPOS)” incompatibility issue.
  • Fixed wording of already expired pages.


  • Possible fix for page slowdown for unregistered users.


  • Fixed count error for view restriction.


  • Fixed some warnings.


  • Added notice for custom post types where the feature “Custom Fields” is missing.


  • Fixed “PHP Fatal error: Uncaught TypeError: in_array(): Argument #2 ($haystack) must be of type array…” error.


  • Fixed undefined array key 0 that happened.


  • Added prwc_restricted_pages_products shortcode.
  • Minor fixes


  • Fixed “Lock by Products” not able to accept more than 1 product on “Pages” page.


  • Fixed Time Table not showing pages with bought products with no expiration.


  • Fixed issue with $all_pages.


  • Fixed issue with not bought and not logged in restrict message options not showing any pages on the classic editor.
  • Added further warnings for redirecting to private pages.
  • Removed unused code (future feature).
  • Refactored “Quick Start” page.


  • Fixed issue where the list of pages isn’t the same in the Pages page and the Settings page.


  • Performance fixes. It should be considerably faster now.
  • Fixed various PHP warnings.


  • Fixed bool passed to count error.


  • Fixed custom post types not showing in “User Overview” and “Page Restrict” page on My Account.


  • Added features to view ant time table on My Account page.
  • Fixed issue with loading a limited number of pages for views.
  • Rephrased the “Not all products required” option description in the Quick Start page.
  • Fixed shortcode issue on Quick Start page.
  • Translation fixes.


  • Fixed showing pages when product wasn’t bought.
  • Fixed “ModuleNotFoundError: Module not found: Error: Can’t resolve ‘react’ in” which seems to happen in the admin/assets/src/scss/admin.scss file.
  • Changed Quick Start text.


  • Fixed translation issues.


  • Fixed issue with User Overview page not showing pages restricted by products.


  • Fixed problems with Views tab in User Overview that prevents from showing users that bought product unless they viewed the page at least once.
  • Smaller design issues (horizontal bar in User Overview).
  • My Account fixes.


  • Design changes.
  • Showing order, product ids on User Overview page.
  • Refactored variables
  • Fixed issues with my-account Page Restrict tab.
  • Design changes to “User Overview” page.


  • Fixed issue with “User Overview” not showing users correctly, restricting also didn’t work.
  • Some minor refactoring
  • Design changes to “User Overview” page.
  • Language files update.


  • Fixed issue with reverse block where it doesn’t show for guests.


  • Fixed “My Account” pages restricted pages list page not showing active restricted pages at all.


  • Fixed issue where the “User Overview” page would be empty if timeout would not be set. It should be able to show if you only need to show if product purchased.
  • Fixed issue with incorrect expiration time.


  • Updated Javascript dependencies.
  • Removed unnecessary code.


  • Updated the React JS code to be in JSX.
  • Some smaller changes.


  • Adding “Not all products required” feature.
  • Fixed bugs
    • Fixed problems with existing products bought checking. It counted only the first full set of products if users needed to buy multiple products.
    • Incorrect order list.


  • Fixed Quick Start text.
  • Fixing bugs.
    • Fixed incorrect namespace used.
    • Fixed guest users executing table list code.
    • Fixed $_POST not having nonce.


  • Admins now can see which users have bought products needed to access pages. It shows users who recently bought it and are valid as a blue color and the users who have expired pages have those in red.
  • Regular users can see their bought (expired or still valid) pages for their account as well. They can see it in their WooCommerce My Account page, or on a separate page using a Gutenberg block or shortcode.
  • Added animation for pagination.
  • Fixed not removing everything on uninstall.
  • Fixed adding data that is not needed.


  • Initial commit.