To protect your website from hacker attacks, you can allow the access to the admin panel only from your IP. 

To do this, you’ll need to know:

  1. Your IP address (you can check it at https://www.whatismyip.com/).
  2. Whether or not it is static. Your internet provider can tell you this. 

IMPORTANT: This manual works only for static IPs.

How to allow access to wp-admin only to some IPs

  1. Log into cPanel
  2. Click File managerDS_290617_4a22dd
  3. Double click the public_html folder.DS_290617_3791ba
  4. Click the .htaccess file.DS_290617_a43c3f
  5. Click Edit.DS_290617_ee5912
  6. Paste this code under RewriteEngine on
    RewriteCond %{REQUEST_URI} ^(.*)?wp-login\.php(.*)$ [OR]
    RewriteCond %{REQUEST_URI} ^(.*)?wp-admin$
    RewriteCond %{REMOTE_ADDR} Your IP Goes Here$
    RewriteCond %{REMOTE_ADDR} Some Other IP You May Use Go Here$
    RewriteRule ^(.*)$ - [R=403,L]
  7. Click Save Changes.DS_290617_25f8f2
  8. Click Close.

From now on, only users with the IPs defined in the .htaccess will be able to access the admin panel of your website.