In this tutorial, we will show you how to restrict WordPress posts by donations form from GiveWP. This can be incredibly useful if you write a series of posts that you want only donors to a cause to access. Your posts could be a donation award, articles of interest about the causes the donations are focused on, etc.
Normally, this would take many hours because you would have to program these conditional restrictions from scratch. And if you don’t know how to program, it’s impossible and you would have to spend months or years learning or hiring a programmer for a limited number of conditional restrictions.
Fortunately, with the WordPress Conditional Post Restrictions plugin, you don’t have to worry about programming anything or using even one line of code. You can quickly apply conditional restrictions to your posts, pages, or other custom post types generated by other plugins.
In the GiveWP plugin, we create a donation form for each cause we want to raise funds for. In this case, we will use a specific donation form to distinguish donors to a specific cause, and that donation form will be converted into a conditional parameter to restrict our posts.
To do this, you need to follow these simple steps.
1- Install the WordPress Conditional Post Restrictions plugin
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more
Once installed and activated, you can proceed to restrict your posts for users who donate to a specific cause.
2- How to restrict individual posts by donations form
To restrict individual posts for users by donations form, you must go to Posts > All posts, and open any post you want to edit.
Once opened, you need to scroll down to go to the Restriction rules section. Then, you need to select the following values to restrict this post to users who donate to a specific cause:
- Enable content restrictions: Yes
- What happens when the conditions are met: Allow access. Only users who meet the condition will have access to this post.
- Condition 1: User has donated for form = Donation Form. Select the donation form to which you want to restrict this post. We’ve selected the example donation form that comes with GiveWP.
- Once you do that, Update the post to apply the changes.
This is how you restrict a WordPress post for users who donate to a specific cause. You need to repeat this to apply the same change to other posts.
3- How to restrict an entire posts category by donations form
Maybe you don’t want to edit posts one by one and instead want to restrict an entire category of posts to give access to donors to a specific cause only. No problem. You can easily do it with the WordPress Conditional Post Restrictions plugin.
Go to Posts > Categories, and open the category you want to edit.
Once there, you need to apply the following changes to the selected category:
- Enable the conditional restrictions: Yes
- Apply restrictions to: Category and posts
- What happens when the conditions are met: Allow access. Only users who meet the condition will have access to this post.
- Condition 1: User has donated for form = Donation Form. Select the donation form to which you want to restrict this post. We’ve selected the example donation form that comes with GiveWP.
- Once you’re done, Update the category to save the changes.
This is how you can restrict an entire category of WordPress posts by donations form.
4- What happens when users try to access a post or posts category that is not available for them?
The WordPress Conditional Post Restrictions plugin gives you different options to decide what happens when users try to access a post or posts category that is not available form them.
You need to configure those options in the global settings of the plugin. Go to Settings > Post restrictions in wp-admin.
Now you’ll find these options and fields:
- You’ll see a list of user roles for which the conditions won’t be applied. By default, we will not apply restrictions for administrators, editors, and any user with the capability edit_others_posts.
- Also, you be able to redirect users to another URL, remove the content and show a message, or show fragment of the content and show message after fragment.
- Once you select what happens when users try to access a post that is not available for them, save changes.
That’s so easy!
You see? You don’t have to program anything! You can easily apply this any other conditional restrictions to your WordPress posts, pages, or custom post types generated by other plugins.
Your donations platform will be enriched because WordPress Conditional Post Restrictions gives you lots of possibilities and opportunities to manage your content better!
You can download the plugin here:
Download WordPress Conditional Post Restrictions Plugin - or - Read more