Reference: https://www.malcare.com/blog/restrict-admin-access-on-wordpress/ Navigate to the root directory of your WordPress installation. . Look for the .htaccess file in the wp-admin folder. Edit .htaccess and paste below code. Replace ‘12.34.56.789’ with the actual IP address of your computer. If necessary, restart the server with below command.