Blog

How to Optimize your WordPress Website with Content Restriction?

WordPress Content restriction is one of the most crucial functionalities for WordPress websites. Especially, if you are running a membership or subscription website.

The content restriction allows you to restrict various levels of content on a WordPress website.

Using this feature you can bar access to a menu item, a certain section of the website, premium content, media download, and much more.

Most of the membership WordPress plugins, subscription plugins, and content restriction plugins in WordPress provide this feature.

To optimize your site with content restrictions, you can utilize ProfileGrid Memberships.

In fact, this plugin can simply be called a WordPress content restriction plugin as the content restriction is one of its core features.

 

Overview of Content Restriction 

Content Restriction

The WordPress content restriction plugin can help in taking complete control of your website’s content. Moreover, the plugin restricts the access of the users on pages and blog posts wherever it is enabled.

Additionally, it can also restrict other functionalities such as images, sidebars, and footer widgets, etc for specific users.

There are options to set the visibility of the content either to everyone, logged-in users, your friends, or only you.

Features of Content Restriction 

Content restriction on WordPress allows you to do the following:

  • ProfileGrid adds Content Restriction settings to all existing pages or posts in your dashboard.
  • Restrict the logged-in/logged-out users or other users to access the website pages/posts.
  • Restrict the users to access tags, media, or any other website content.
  • Displays a system-generated message to the users who do not have permission to view the content.
  • Redirect the users back to the home page/post who do not have permission to view the content.
  • Make the website content accessible either to everyone, logged-in users, your friends, or only you.
  • Restrict the visibility of sidebars or widgets to logged-in users, friends, or only you.
  • Using shortcodes, restrict the visibility of content.
  • Hide the content within the shortcodes for members of a specific group.
  • Display the content only for group managers.

Explore more about the Content Restriction on WordPress here.

Steps to Restrict Content on your WordPress Website

Content Restriction is one of the premium features of ProfileGrid that allows you to restrict content on WordPress websites.

To set up WordPress content restriction, you can either download the free ProfileGrid Memberships plugin or you can download the Premium version that comes with more advanced features.

Try ProfileGrid!

Once you have downloaded and installed the plugin on your WordPress website, follow the steps below:

Content Restriction Settings

Step1: Go to your WordPress Dashboard, hover the cursor over the ProfileGrid menu, and click ‘Global Settings.’

Content Restriction

Step2: Click on Content Restrictions.

Content restriction

Step3: This will redirect you to the “Content Restriction” page. On this, you will find the details related to the setting options.

Content Restriction

Note: As content restriction is a building feature of ProfileGrid, you can set restrictions directly from your posts and pages.

Setting Content Restriction on a Post

Step1: Hover your cursor over ‘Posts’ and click on ‘Add New.’

Content Restriction

Step2: On the New Post page, scroll down and you will find ProfileGrid content restriction.

Content Restriction

Step3: Enable the ‘Apply custom access settings?’ toggle.

Content Restriction

Step4: Once you enable the toggle you get various options to set the availability of your content.

Content Restriction

Step5: The first option allows everyone to access the post content.

Content Restriction

Step6: The second option allows you to make your content accessible only to the logged-in users.

Content Restriction

Step7: Additionally, under this setting, you can select the user group that can see the content.

Content Restriction

Step8: Further, the next three settings are Members of Author’s Groups, Content accessible to My Friends, and Content accessible to Only Me.

Restrict content

Step9: Subsequently, here we have set the page title ‘Content Restriction Demo’ and published the page with ‘Content Accessible to Only Me.’

Post restriction demo

Here is how the post will display if anyone except the publisher of the post tries to access the post.

content

Setting Content Restriction on a Page

Step1: Hover your cursor over ‘Pages’ and click on ‘Add New.’

Content restriction

Step2: Scroll down and you will find the same setting options.

Content Restriction

Step3: The rest of the settings for pages are exactly the same as posts.

Content Restriction

Step4: For example, we have kept the title of the page as ‘Demo Page Content Restriction Setting.’

Demo Page Content Restriction Setting

Step5: Next we have published the page with ‘Content accessible to Logged In Users.’ And the group selected is ‘Media Group.’

Content accessible to Logged In Users

Step6: Here is how the page will look if anyone except the logged-in users of Media Group tries to access the page.

Content accessible to Logged In Users

Setting Partial Content Restrictions with Shortcodes

Step1: Go to your WordPress dashboard, hover your cursor over ProfileGrid left menu, and click on ‘Shortcodes.’

shortcodes

Step2: On the Shortcodes page, you will find three codes to restrict content. Namely, Conditional Content Display, Conditional Content Hide, and Content Restricted to Group Managers.

Content Restricted to Group Managers

The Conditional Content Display shortcode can be used to restrict the visibility of the content between the codes for all users of a specific group.

The Conditional Content Hide is used to hide the content within the shortcodes from the members of multiple groups using multiple ‘Group IDs’.

And the Content Restricted to Group Managers restricts all the group managers from accessing the content within the shortcodes.

Setting Up Conditional Content Display

Using this shortcode, you can bar a particular group to access the content and allow the rest of the groups to access that content.

By entering the ‘group ID’ of the particular group, you can hide the content from that specific group. This feature can come in handy if you wish to publish group-specific content on your website.

Here, as an example, we are using a ‘demo account’ to showcase this.

Step1: Copy the Conditional Content Display shortcode.

Conditional Content Display

Step2: Create a new post or you can edit your previous pages or posts.

restrict content

Step3: Paste the first half of the shortcode at the beginning of the content and the second half at the end of the content.

restrict content

Note: Any content between the first half and second half of the shortcodes will be hidden from the specified group. You can use this shortcode to hide particular sections of the page or a post. 

Step4: In this shortcode [profilegrid_show gid=”x”] the “x” stands for the group ID. A group ID or ‘gid’ is a unique ID number assigned to every ProfileGrid group. You can find the ‘gid’ on the Group Manager page, below every group.

Here is an example:

group id

Here the gid of the Marketing group is 10.

Step5: So to bar the group members of the Marketing Group, we will replace the “x” with “10”.

restrict content

Step6: Publish or Update the content.

Frontend Examples of Conditional Content Display

Example 1: Here is how the content looks when a member of ‘Marketing Group’ opens the post.

restrict content

The content within the shortcodes is hidden from the member of the ‘Marketing Group.’

Example 2: Here is how the content looks when a member from any other group opens the post.

hide

The content within the Shortcodes is visible to the members of other groups.

Setting Up Conditional Content Hide

The Conditional Content Hide shortcode is used to hide the content between the shortcodes from multiple groups. You can bar members of more than one group from accessing the content.

Here, is an example:

Step1: Copy the Conditional Content Hide shortcode.

Copy the Conditional Content hide shortcode.

Step2: Create a post/page or edit an existing post/page and paste the first half of the shortcode at the beginning of the content and the second half and the end of the content.

Restrict content

Step3: Replace the ‘x,y,z’ from [profilegrid_hide gid=”x,y,z”] with the group IDs and publish the post.

Here we have replaced ‘x,y,z’ with ‘1o,9,7.’ Which are the group IDs for Marketing Group, Media Group, and Bloggers Group.

hide

It will hide the content inside the codes from all the group members of these groups.

restrict

Note: Any content between the first half and second half of the shortcodes will be hidden from the specified groups. You can use this shortcode to hide particular sections of the page or a post from multiple groups.

Frontend Examples of Conditional Content Hide

Example 1: This is how the post would look on the front end if users from Marketing Group, Media Group, and Bloggers Group open the post.

hide content

Here the content within the Shortcodes is hidden from all the members of the specified groups.

Example 2: Here is how the post will appear for the rest of the groups.

hide

The content within the Shortcodes is visible to the members of other groups.

Setting Up Content Restricted to Group Managers

This Shortcode enables you to restrict all the group managers from accessing the content. It does not require you to specify the group IDs as it is applicable to all the groups.

It can be used to display special discount codes, information, disclaimer, notice, and more, only for the members of the groups and hide it from the group managers.

Here, is an example:

Step1: Copy the Content Restricted to Group Managers shortcode.

Content Restricted to Group Managers

Step2: In any post or page (can be new or existing), paste the first half of the shortcode at the beginning of the content and the second half and the end of the content.

Here, as an example, we are using a 'demo account' to showcase this.

Step3: Here you do not need to specify any group or groups.

Note: Any content between the first half and second half of the shortcodes will be hidden from the group managers of all groups. You can use this shortcode to hide particular sections of the page or a post from all group managers.

Frontend Examples of Content Restricted to Group Managers

Example 1: Publish the post and this is how it would look on the front end if any group manager from any group opens the post.

hide Content Restricted to Group Managers

Here the content within the shortcodes is hidden from all the group managers.

Example 2: Here is how it would look if any other user from any group opens the post.

how it would look on the front end if any group manager from any group opens the post

Here the content is visible for all the other group members except group managers.

You can also explore other advanced Content Restriction features of ProfileGrid Memberships, in the additional resources listed below.

Additional Resources:

How To Hide Or Show Menu Items On Your WordPress Website?

Restrict Content on WordPress Site with Ease

Free WordPress membership plugin with member area, content restriction and paid subscriptions

Ending Note

ProfileGrid Memberships allows you to set restrictions on your website menus, pages, posts, blogs, and categories. Furthermore, using the content restriction feature, you can easily prohibit users to access your website content.

This plugin is a complete solution for your memberships, subscriptions & content restriction needs. Comment below if you need further assistance in setting up content restrictions on your website. Our experts will reach out to you with the best solutions.

Try ProfileGrid for Free!

8 Comments

  1. Umberto

    Hi, can I restrict access all old and new articles at once?

    1. ProfileGrid

      Currently, you have to apply the content restriction on articles one by one, it cannot be applied to all articles at one time.

  2. Matheus

    Hello, I can do a redirect to another page with the content restriction?

    1. ProfileGrid

      It cannot be redirected to another page with content restrictions as of now.

  3. Stratus

    How in the heck can you simply content restrict an entire page? That is a core necessity and if this does not have that then what good is it?

    1. ProfileGrid

      Currently, It restricts the page content only. We have noted and forwarded this feature to our team for further review and analysis.

  4. Piotr

    Hi
    How can I change restricted message ” Login required to view this page. Please Login. ” from restricted page?

    I would like to change color of the background ot hta message and message

    Thanks

    1. ProfileGrid

      You may change the restricted message using the “Loco Translate” plugin. ProfileGrid has a POT file that includes all English text from the plugin for translation. Please read this article for more details: https://profilegrid.co/how-to-translate-profilegrid-to-your-language/. You may change the background color of the message using the custom CSS.

Leave a Comment

Your email address will not be published. Required fields are marked *