{"id":387327,"date":"2026-11-05T16:40:32","date_gmt":"2026-11-05T16:40:32","guid":{"rendered":"https:\/\/wordpress.org\/plugins\/role-visibility-hide-pages-posts-based-on-roles\/"},"modified":"2026-11-05T18:33:22","modified_gmt":"2026-11-05T18:33:22","slug":"deadbolt","status":"publish","type":"plugin","link":"https:\/\/hat.wordpress.org\/plugins\/deadbolt\/","author":20566778,"comment_status":"closed","ping_status":"closed","template":"","meta":{"version":"1.0.1","stable_tag":"1.0.1","tested":"7.1.4","requires":"6.0","requires_php":"8.0","requires_plugins":null,"header_name":"Deadbolt \u2014 Restricted Page Templates","header_author":"PluginRx","header_description":"Restrict pages and posts by role, user or login status, and show each blocked visitor a customizable template that explains why.","assets_banners_color":"5a5963","last_updated":"2026-11-05 18:33:22","external_support_url":"","external_repository_url":"","donate_link":"","header_plugin_uri":"https:\/\/pluginrx.com\/plugin\/deadbolt\/","header_author_uri":"https:\/\/pluginrx.com\/","rating":0,"author_block_rating":0,"active_installs":0,"downloads":136,"num_ratings":0,"support_threads":0,"support_threads_resolved":0,"author_block_count":0,"sections":["description","installation","faq","changelog"],"tags":{"1.0.1":{"tag":"1.0.1","author":"apos37","date":"2026-11-05 18:33:22","revision":3786565}},"upgrade_notice":[],"ratings":[],"assets_icons":{"icon-128x128.png":{"filename":"icon-128x128.png","revision":3786387,"resolution":"128x128","location":"assets","locale":"","width":128,"height":128},"icon-256x256.png":{"filename":"icon-256x256.png","revision":3786387,"resolution":"256x256","location":"assets","locale":"","width":256,"height":256}},"assets_banners":{"banner-1544x500.png":{"filename":"banner-1544x500.png","revision":3786387,"resolution":"1544x500","location":"assets","locale":"","width":1544,"height":500},"banner-772x250.png":{"filename":"banner-772x250.png","revision":3786387,"resolution":"772x250","location":"assets","locale":"","width":772,"height":250}},"assets_blueprints":{},"all_blocks":[],"tagged_versions":["1.0.1"],"block_files":[],"assets_screenshots":{"screenshot-1.png":{"filename":"screenshot-1.png","revision":3786387,"resolution":"1","location":"assets","locale":"","width":1400,"height":860},"screenshot-2.png":{"filename":"screenshot-2.png","revision":3786387,"resolution":"2","location":"assets","locale":"","width":1400,"height":860},"screenshot-3.png":{"filename":"screenshot-3.png","revision":3786387,"resolution":"3","location":"assets","locale":"","width":1400,"height":860},"screenshot-4.png":{"filename":"screenshot-4.png","revision":3786387,"resolution":"4","location":"assets","locale":"","width":1400,"height":860},"screenshot-5.png":{"filename":"screenshot-5.png","revision":3786387,"resolution":"5","location":"assets","locale":"","width":1400,"height":860},"screenshot-6.png":{"filename":"screenshot-6.png","revision":3786387,"resolution":"6","location":"assets","locale":"","width":1240,"height":760},"screenshot-7.png":{"filename":"screenshot-7.png","revision":3786387,"resolution":"7","location":"assets","locale":"","width":760,"height":648}},"screenshots":{"1":"The Pages overview, with a post type expanded to show its restricted posts and templates","2":"Writing a template in the block editor, with its settings and merge tags","3":"The templates list, showing when and where each template applies","4":"Settings","5":"The Access box on the edit screen, with roles, specific users and the templates in use","6":"The Access column, with templates shown, and Quick Edit","7":"Menu item visibility"}},"plugin_section":[],"plugin_tags":[290912,1912,19898,17051,11917],"plugin_category":[],"plugin_contributors":[213848],"plugin_business_model":[],"class_list":["post-387327","plugin","type-plugin","status-publish","hentry","plugin_tags-access-denied","plugin_tags-access-control","plugin_tags-members-only","plugin_tags-restrict-content","plugin_tags-user-roles","plugin_contributors-apos37","plugin_committers-apos37","plugin_support_reps-aristocles"],"banners":{"banner":"https:\/\/ps.w.org\/deadbolt\/assets\/banner-772x250.png?rev=3786387","banner_2x":"https:\/\/ps.w.org\/deadbolt\/assets\/banner-1544x500.png?rev=3786387","banner_rtl":false,"banner_2x_rtl":false},"icons":{"svg":false,"icon":"https:\/\/ps.w.org\/deadbolt\/assets\/icon-128x128.png?rev=3786387","icon_2x":"https:\/\/ps.w.org\/deadbolt\/assets\/icon-256x256.png?rev=3786387","generated":false},"screenshots":[{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-1.png?rev=3786387","caption":"The Pages overview, with a post type expanded to show its restricted posts and templates"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-2.png?rev=3786387","caption":"Writing a template in the block editor, with its settings and merge tags"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-3.png?rev=3786387","caption":"The templates list, showing when and where each template applies"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-4.png?rev=3786387","caption":"Settings"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-5.png?rev=3786387","caption":"The Access box on the edit screen, with roles, specific users and the templates in use"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-6.png?rev=3786387","caption":"The Access column, with templates shown, and Quick Edit"},{"src":"https:\/\/ps.w.org\/deadbolt\/assets\/screenshot-7.png?rev=3786387","caption":"Menu item visibility"}],"raw_content":"<!--section=description-->\n<p>Most access plugins hide a page and show one generic \"access denied\" line. <strong>Deadbolt<\/strong> lets you decide who can view each page, post or custom post type, and then shows each blocked visitor a message written for them.<\/p>\n\n<p>Visitors who cannot view something are sent to your No Access Page. There, the plugin picks the template that best matches the page they tried to open and the reason they were stopped, and fills it in with links to log in, register, log out or try again.<\/p>\n\n<h4>Who it's for<\/h4>\n\n<ul>\n<li><strong>Member-only areas:<\/strong> keep pages for logged-in users and point everyone else to log in or register, without setting up a full membership plugin.<\/li>\n<li><strong>Staff portals and intranets:<\/strong> limit internal pages, documents and menus to certain roles or specific employees.<\/li>\n<li><strong>Client portals:<\/strong> give each client pages that only their user accounts can open.<\/li>\n<li><strong>Schools, training and course sites:<\/strong> show lessons and resources only to enrolled roles, with a clear message for everyone else.<\/li>\n<li><strong>Nonprofits, associations and local government:<\/strong> keep board, volunteer or staff resources private on an otherwise public site.<\/li>\n<li><strong>Campaigns and partner links:<\/strong> open landing pages only to visitors who arrive from your email, QR code or partner link, using a URL Parameter rule.<\/li>\n<li><strong>Sites with logged-out-only pages:<\/strong> send logged-in users away from login, registration or signup pages with a friendly message.<\/li>\n<\/ul>\n\n<p>Deadbolt controls who can view content. It does not take payments, sell memberships or create public-facing user profile pages. Access is based on standard WordPress roles and users, so it works with any plugin that assigns them.<\/p>\n\n<h4>Customizable templates<\/h4>\n\n<p>Templates are the heart of the plugin. Each one is a regular post you write in the block editor or the Classic Editor, with full formatting, images, buttons and columns.<\/p>\n\n<ul>\n<li><strong>Write a template for each situation:<\/strong> the visitor needs to log in, the user lacks the required role or user access, a logged-in user opened a page meant for logged-out visitors, or the link does not match the page's URL Parameter rule.<\/li>\n<li><strong>Choose where it applies:<\/strong> use a template everywhere, for certain post types, or for specific posts and pages.<\/li>\n<li><strong>Templates for specific posts follow each post's Access setting:<\/strong> they show to whoever that post blocks, or you can limit them to certain situations.<\/li>\n<li><strong>The best match wins:<\/strong> a template for a specific post beats one for the post type, which beats a global one. If two tie, the most recently edited one is used.<\/li>\n<li><strong>Merge tags:<\/strong> drop in login, logout, register, retry and homepage links or URLs, the title and URL of the restricted page, the roles that can view it, the visitor's name and the site name. Tags also work inside link and button URLs, and visitors return to the page they wanted after logging in.<\/li>\n<li><strong>See what visitors will see:<\/strong> the Access box lists the templates in use and updates as you change the access, before you save. Optionally list them in the post list's Access column too, with unique templates marked.<\/li>\n<li><strong>Safe defaults:<\/strong> four ready-made templates are created for you, and a built-in message is used whenever no template matches.<\/li>\n<\/ul>\n\n<h4>An overview of everything restricted<\/h4>\n\n<p>The <strong>Pages<\/strong> screen counts the restricted content in each post type, split into Logged-In Only, Logged-Out Only, URL Parameter and Everyone. Expand a post type to list its restricted posts, their access and the templates blocked visitors will see.<\/p>\n\n<h4>Flexible access rules<\/h4>\n\n<ul>\n<li><strong>Per post:<\/strong> Everyone, Logged-In Only, Logged-Out Only or URL Parameter, from a box on the edit screen, Quick Edit or Bulk Edit.<\/li>\n<li><strong>By role or by user:<\/strong> limit \"Logged-In Only\" content to certain roles, to specific users, or to both.<\/li>\n<li><strong>By URL parameter:<\/strong> let anyone view the content when the link they arrive with matches a rule: a parameter is, is not, contains, does not contain, starts with, ends with, is greater than or is less than a value. A missing parameter counts as empty, so \"id is not\" with no value only opens the page for links that carry an id.<\/li>\n<li><strong>Post type defaults:<\/strong> choose which post types have access controls and the access their content uses unless a post says otherwise.<\/li>\n<li><strong>Administrator bypass:<\/strong> optionally let administrators view everything.<\/li>\n<\/ul>\n\n<h4>Hide restricted content everywhere<\/h4>\n\n<p>Restricted content is always protected when visited directly. You can also remove it, for anyone who cannot view it, from:<\/p>\n\n<ul>\n<li>Archives, the blog page and post lists, including Query Loop blocks and most page builder widgets<\/li>\n<li>Search results<\/li>\n<li>RSS feeds<\/li>\n<li>The REST API<\/li>\n<li>XML sitemaps from WordPress, Yoast SEO, Rank Math, All in One SEO and SEOPress<\/li>\n<li>Previous and next post links<\/li>\n<li>Navigation menus, in Appearance &gt; Menus and in the Navigation block, where items linking to content can simply match that content's access<\/li>\n<\/ul>\n\n<h4>Lightweight<\/h4>\n\n<ul>\n<li><strong>Access control without the extras:<\/strong> no payments, subscriptions, profiles or member directories to set up, maintain or slow your site down. Just who can view what, and what they see when they can't.<\/li>\n<li>Access rules are kept in one cached index, so hiding content adds no post meta joins to your queries.<\/li>\n<li>Scripts and styles only load on the screens that use them.<\/li>\n<li>No extra database tables, no external requests and no upsells.<\/li>\n<\/ul>\n\n<h4>For developers<\/h4>\n\n<p>Actions and filters are available on our <a href=\"https:\/\/pluginrx.com\/docs\/plugin\/deadbolt\/\">developer docs<\/a>.<\/p>\n\n<h4>More from PluginRx<\/h4>\n\n<p>See our other free plugins on <a href=\"https:\/\/profiles.wordpress.org\/apos37\/#content-plugins\">WordPress.org<\/a> or at <a href=\"https:\/\/pluginrx.com\/\">pluginrx.com<\/a>.<\/p>\n\n<h3>Demo<\/h3>\n\n<p>https:\/\/youtu.be\/54ROToOSX6Y<\/p>\n\n<!--section=installation-->\n<ol>\n<li>Install the plugin from Plugins &gt; Add New, or upload the <code>deadbolt<\/code> folder to <code>\/wp-content\/plugins\/<\/code>.<\/li>\n<li>Activate the plugin through the Plugins screen.<\/li>\n<li>Go to <strong>Deadbolt &gt; Settings<\/strong> and select or create your <strong>No Access Page<\/strong>. It must contain the <code>[deadbolt]<\/code> shortcode - creating this page from Settings automatically adds the shortcode.<\/li>\n<li>Under <strong>Post Types<\/strong>, enable the post types you want to control and choose their default access.<\/li>\n<li>Edit a post or page and choose who can view it in the <strong>Access<\/strong> box.<\/li>\n<li>Customize what blocked visitors see under <strong>Deadbolt &gt; Templates<\/strong>.<\/li>\n<li>Check everything that is restricted under <strong>Deadbolt &gt; Pages<\/strong>.<\/li>\n<li><strong>ALWAYS<\/strong> test access to ensure it's working properly.<\/li>\n<\/ol>\n\n<!--section=faq-->\n<dl>\n<dt id=\"why%20can%20visitors%20still%20view%20restricted%20pages%3F\"><h3>Why can visitors still view restricted pages?<\/h3><\/dt>\n<dd><p>Visitors are only redirected once a published No Access Page is selected under Deadbolt &gt; Settings. Also check that the post type is enabled under Post Types.<\/p><\/dd>\n<dt id=\"how%20does%20the%20plugin%20choose%20which%20template%20to%20show%3F\"><h3>How does the plugin choose which template to show?<\/h3><\/dt>\n<dd><p>When a visitor is redirected, the No Access Page looks at the restricted post, the link the visitor arrived with, and the reason they were blocked: they need to log in, they lack the required role or user access, they are logged in on a logged-out-only page, or their link does not match the page's URL Parameter rule. A template for that specific post wins over one for its post type, which wins over a global one. If nothing matches, a built-in default is used.<\/p><\/dd>\n<dt id=\"how%20does%20url%20parameter%20access%20work%3F\"><h3>How does URL Parameter access work?<\/h3><\/dt>\n<dd><p>Choose URL Parameter as the access for a post, or as a post type's default, then enter a parameter name, a condition and a value. Visitors whose link matches can view the content, logged in or not, and everyone else is sent to the No Access Page and shown your \"URL Parameter Not Met\" templates. For example, \"id is not\" with no value requires links like <code>?id=123<\/code>, while \"ref is email\" only opens the page from your email links. When hiding restricted content from archives, search, feeds, sitemaps and menus, links are checked without parameters, so the content is listed only if its rule matches an empty parameter. WordPress query names, such as p, s and page_id, can't be used.<\/p><\/dd>\n<dt id=\"can%20i%20show%20a%20different%20message%20on%20one%20page%3F\"><h3>Can I show a different message on one page?<\/h3><\/dt>\n<dd><p>Yes. In the Access box on that page, click \"Create a unique template for this post\". Alternatively, create a new template and choose \"Specific Posts\" as the Scope and choose the page you want. Then select \"Follows each post's Access setting.\" You will still need to select the Access point on the page itself if you don't want it set to the default.<\/p><\/dd>\n<dt id=\"which%20merge%20tags%20are%20available%3F\"><h3>Which merge tags are available?<\/h3><\/dt>\n<dd><p>{login_link}, {login_url}, {logout_link}, {logout_url}, {register_link}, {register_url}, {retry_link}, {retry_url}, {home_link}, {home_url}, {post_title}, {post_url}, {required_roles}, {user_display_name} and {site_name}. The Merge Tags box on the template screen lists them all, and developers can add more with the <code>deadbolt_merge_tags<\/code> filter.<\/p><\/dd>\n<dt id=\"will%20hiding%20restricted%20content%20work%20with%20my%20theme%20and%20plugins%3F\"><h3>Will hiding restricted content work with my theme and plugins?<\/h3><\/dt>\n<dd><p>Restricted content is always protected when visited directly. The optional hiding features depend on how your theme and other plugins load content:<\/p>\n\n<ul>\n<li><strong>Archives, search and feeds<\/strong> cover queries made through WordPress, including Query Loop blocks and most page builder widgets. Content loaded with custom database queries, or with <code>suppress_filters<\/code> turned on, is not affected.<\/li>\n<li><strong>Front-end AJAX<\/strong> requests, such as \"load more\" buttons, are not filtered by default. Developers can add <code>'deadbolt_context' =&gt; 'archives'<\/code> to the query arguments to include them.<\/li>\n<li><strong>XML sitemaps<\/strong> are supported for WordPress core, Yoast SEO, Rank Math, All in One SEO and SEOPress. Other sitemap generators may still list restricted content. Remember to clear your SEO plugin's sitemap cache after changing access.<\/li>\n<li><strong>Navigation menus<\/strong> work in Appearance &gt; Menus and in the Navigation block. Menus built by page builders or other menu plugins may not be affected. The Customizer's menu editor does not show the visibility controls.<\/li>\n<li><strong>Previous\/next links<\/strong> work with WordPress functions and blocks. Themes that build these links with their own queries may still show restricted posts, but those posts are still protected when clicked.<\/li>\n<\/ul><\/dd>\n<dt id=\"is%20the%20hiding%20feature%20fast%20on%20large%20sites%3F\"><h3>Is the hiding feature fast on large sites?<\/h3><\/dt>\n<dd><p>Yes. Access rules are kept in a single cached index, so no post meta joins are added to your queries. For the best performance, restrict whole post types with the default access and allow exceptions per post, rather than restricting thousands of posts one by one.<\/p><\/dd>\n<dt id=\"does%20it%20work%20with%20caching%20plugins%3F\"><h3>Does it work with caching plugins?<\/h3><\/dt>\n<dd><p>Restricted pages redirect before any content is sent, and the No Access Page tells caching plugins not to cache it. If a page cache serves logged-out visitors, clear it after changing access rules.<\/p><\/dd>\n<dt id=\"what%20happens%20to%20my%20data%20when%20i%20delete%20the%20plugin%3F\"><h3>What happens to my data when I delete the plugin?<\/h3><\/dt>\n<dd><p>Nothing is removed unless you check \"Remove All Plugin Data on Uninstall\" under Settings &gt; Advanced.<\/p><\/dd>\n<dt id=\"where%20can%20i%20request%20features%20and%20get%20further%20support%3F\"><h3>Where can I request features and get further support?<\/h3><\/dt>\n<dd><p>We recommend using our <a href=\"https:\/\/pluginrx.com\/support\/plugin\/deadbolt\/\">website support forum<\/a> as the primary method for requesting features and getting help. You can also reach out via our <a href=\"https:\/\/discord.gg\/3HnzNEJVnR\">Discord support server<\/a> or the <a href=\"https:\/\/wordpress.org\/support\/plugin\/deadbolt\/\">WordPress.org support forum<\/a>, but please note that WordPress.org doesn\u2019t always notify us of new posts, so it\u2019s not ideal for time-sensitive issues.<\/p><\/dd>\n\n<\/dl>\n\n<!--section=changelog-->\n<h4>1.0.1<\/h4>\n\n<ul>\n<li>Initial release.<\/li>\n<\/ul>","raw_excerpt":"Restrict pages by role, user or login status, and show every blocked visitor a customizable template that explains why and what to do next.","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin\/387327","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin"}],"about":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/types\/plugin"}],"replies":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/comments?post=387327"}],"author":[{"embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wporg\/v1\/users\/apos37"}],"wp:attachment":[{"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/media?parent=387327"}],"wp:term":[{"taxonomy":"plugin_section","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_section?post=387327"},{"taxonomy":"plugin_tags","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_tags?post=387327"},{"taxonomy":"plugin_category","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_category?post=387327"},{"taxonomy":"plugin_contributors","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_contributors?post=387327"},{"taxonomy":"plugin_business_model","embeddable":true,"href":"https:\/\/hat.wordpress.org\/plugins\/wp-json\/wp\/v2\/plugin_business_model?post=387327"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}