block IP wordrpess for the next X minutes

I would like to implement same example from here, about not allow you to publish another question after 40 minutes of your first question.

I have a Wordpress site and users ( register and no register) can submit post. That should be a really good idea to not allow users (checking IP ) to publish in the next 40 minutes for example if they actually published something.

Anybody can help me? Thank for all ;)

Topic ip Wordpress

Category Web


you need to create a post meta with ip value. And check it if ip available in database or not. you need to delete this meta key with value between 39 to 41 minute. write a function to delete meta key with value in 40th minute. paste This function on single.php Check ip available in db or not

$query = new WP_Query( 'meta_key=ip&meta_value='.$ip_address );
if ( $query->have_posts()){ 
//do something to block
}

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.