/*Add a custom field to login form with an answer: */ function custom_login_question() { if ( isset( $_POST['log'] ) && ! empty( $_POST['log'] ) ) { if ( $_POST['custom_question'] != 'Answer to Question' ) { wp_die( 'Incorrect answer. Please try again.' ); } } } add_action( 'wp_authenticate', 'custom_login_question' ); /*Write your custom question here */ function custom_question_field() { echo '

Write your Question here?
'; echo '

'; } add_action( 'login_form', 'custom_question_field' );