This WordPress Security tips can protect you against an attack and prevent hackers from continually attempting to login.
Wordpress installations do not come with a default manner in which to stop hackers continually hitting your wp-login page and attempting to login. We recommend you install the Login Security Solution plugin on all your WordPress installations, as well as keep your Wordpress installations up to date with the latest version.
To read about and download the plugin please go to: https://wordpress.org/plugins/login-security-solution/
This security plugin will stop hackers from being able to continuously login to your WordPress installation by tracking IPs and blocking those which are attempting to hack.