You need put the attempts on user meta, then do check every time user hit reset passwords.
add_action( 'password_reset', 'my_password_reset', 10, 2 );
function my_password_reset( $user, $new_pass ) {
$limit=5;// Set the limit here
$attempts=(int) get_user_meta($user->ID,"reset_attempts",true);
if($attempts>$limit){
//Do something in here, example redirect to warning page.
wp_redirect( "/warning" );
exit;
}
update_user_meta($user->ID,"reset_attempts",$attempts++);
}
Related Posts:
- Styling my own password protected page, how to deal with wrong password?
- Redirecting to a custom forgot password page
- How to fix ‘Notice: Undefined index:’ in PHP form action
- Sending the reset password link programatically
- Check for correct username on custom login form
- How to stop form resubmission on page refresh
- Enforcing password complexity
- How to correctly submit a search form and display the result in an independent page
- add_filter the_content str_replace after shortcode
- Genesis – Customize search form
- Metabox repeating fields – radio buttons not saving correctly
- How to exclude pages from the search results
- How to insert PHP code in a WordPress Post
- Inserting Gravity Form checkbox values into Advanced Custom Fields [closed]
- How to handle a custom form in wordpress to submit to another page?
- Change Password Hint
- Has anyone tried putting PHP ActiveRecord on WordPress?
- Handling error states with admin_post
- Creating wordpress user registration form
- Creating a WordPress form with a PHP script and default header
- On update to 3.04 site started recording accents as “á” and “á”, what to do?
- submit the form to same page
- Go to / Scroll to Password Field on WordPress Posts After Submit With Message(s)
- Submitting form via admin-post.php and handling errors
- Implement a multi-value input field where the number of entries is not limited
- Custom WordPress+PHP+MYSQL+AJAX form, submit event not captured by Javascript, but does POST data to the DB
- Passing POST data from one WP post to another
- Getting the dropdown menu to redirect to different pages?
- Processing a subscription form with POST method?
- How to group 2 radio buttons in a widget?
- Ajax form submit within a Post Metabox
- Password protecting content in custom template
- How to filter/hook-into retrieve_password() to filter $_POST[‘user_login’]?
- How to create and work with custom data / tables (i.e., for arbitrary data)?
- Customize reset password form redirect problem
- Upload Image in a WordPress page using PHP
- Using Multiple Submit buttons to trigger customised php functions
- Get Admin Email Address From External PHP page
- Adding Custom Forms
- How do I let users upload files to a chosen location?
- woocommerce registration form with klaviyo(don’t work with current user)
- How to create a form and display its content as table in admin panel?
- Custom Form Processing Issue
- My form action url is being prepended with a directory that does not exists
- Custom profile field with birthday. Troubles with
- How can I reuse the code to capture a param in a URL and place in a value in a hidden form?
- WooCommerce/WordPress: how hide entire table form after submit (Admin Dashboard)?
- How to store data from multiple forms using ajax and php
- How to use $query->set with post__in?
- Ajax loaded form replaces form action with Ajax url
- prevent default not stopping page refresh. Passing form information to and from php with ajax in a wordpress site
- Custom search results page not working with empty search
- Modify HTML structure of fields in woocommerce checkout form
- Post + form + action + results on the same page
- Ajax call return 404
- How to pre populate a form field with a link of a current user’s author profile?
- Why Won’t My Inputs in a form with a Get method work together?
- Input data from email form not going to JSON file
- How to get the value of input hidden html from text editor to custom page template?
- Show success or error messages in Ajax response to WordPress custom registration form
- Contact form won’t submit
- wp_mail file attachment not being placed in upload folder?
- Search Query: how to construct a search string from two select elements?
- Login to wordpress by clicking a link and specifying usernaname and password in url
- Databases – Submitting data from inputs to database [closed]
- How to show a ‘correct’ message after submit a form?
- db converts decimal number wrong
- Form Security: nonce vs. jQuery
- How to know where this function definition is declared?
- WordPress admin-ajax.php 400 bad request
- Ajax contact form return 0
- Trying do build a contact form
- “operation successful” message
- User register hook is not working in woocomerce register form
- Password minimum length in personal subscription [closed]
- Search WordPress using static html page
- How to execute html code inside php?
- How to put a form with php code into a variable or shortcode?
- Can a page contain php code?
- How to send form data from WordPress (Meta Box) to an OData service?
- What is the alternative code to if (isset ($_POST) && !empty ($_POST) to avoid warnings?
- WordPress shortcode returns the data before
- Shortcode to embed Edit Account form not working
- Form Submission Not Working In Custom Theme
- Capture form data in one function and use it in another function (same file)
- How do I create a function that modifies a message in the wp-login.php file?
- WordPress produces identical hash all the time
- Change page password every day (predictable password ;) )
- How to display success message correctly and delete it when the page is refreshed
- Using admin-post.php for admin form but it directs me to admin-post.php white screen
- Why does my user not get added to the database on custom registration?
- Submitting a form, using Ajax, to run a SQL Select query based on user input from the form
- How to add post meta in while loop?
- How to set cookies
- Can we stop session reset if page reloads?
- PHP Contact form
- Get wp_current_user_id using PHP and MySQL
- Adding Additional Variables on Menus Page
- form built dynamically with php, not submitting
- PHP- Why is my contact form keep showing it is invalid? [closed]