You can simply install the plugin – “WP Ghost”, author: John Darrel



Go to WP Ghost->Brute Force
Enable Brute Froce Protection and Save.
In this way, visitor’s ip will be blocked for 1 hour after 5 failed login attempts.
All done!
It’s not recommended to enable other functions in WP Ghost, otherwise there is a chance that your theme or plugins do not work properly.