I would like to know is there any way/Plugin to limit the user published post (in a given time span) by his role?
Like this:
- Role A -> 1 post per day and 30 post total.
- Role B -> 10 post per day and 100 post total.
- Role C -> unlimited.
I know there are some plugin out there that have these features but they only able to control either limit post per day or limit number of posts on role basic, and they are not mutually inclusive on each other.
Note: This is to prevent the real estate platform from being spamed.
(Editors note)
Any ideas?
You can use my plugin Posts Creation Limits which has a per user, per role, per post type, per post status limiting system and combined with its
post_creation_limits_custom_checks
action hook and check if the user has created a post that day already – if so: show the the “limit reached message”. For example:You dont need to rely on
Where I have
$errors
is where you can echo a message, in my case I’ plugging into the WP user frontend.If you wanted to do it by role than you can simply add another if statement checking if that user has the correct role inside the
if ( 1 < $count ) {}
, it does then echo your code or run a redirect to an error page.