This code allows you to lock down your Wordperss Admin Backend so you can only see it from your current IP address.
Open Your File Manager in your cpanel
Navigate to the wp-admin folder home > yoursite> public_html > wp-admin
Create a file called .htaccess (it must have a (.) DOT) this is a hidden security file.
Edit it and add the following code
Order Deny,Allow
Deny from all
Allow from 127.0.0.1
112.123.2.244 (YOUR IP ADDRESS GOES HERE)
WARNING: Make sure that you can always access the admin area through your cpanel and update the IP address if needed.
Implications:
Security: This setup significantly enhances the security of your wp-admin directory by restricting access to a very limited set of IP addresses. It can effectively prevent unauthorized access attempts from the internet.
Accessibility: Only users connecting from the two specified IP addresses will be able to access the WordPress admin area. This means if you, or anyone else who needs admin access, are not using one of these IP addresses, you will be blocked from accessing the admin panel.
Maintenance and Remote Work: If your IP address changes (which is common with dynamic IP addresses provided by ISPs) or if you need to access your admin area from a different location (like while traveling or from a mobile device), you will need to update the .htaccess file accordingly, which could be inconvenient.
Risk of Lockout: There’s a risk of locking yourself out of your own admin area if the IP addresses are not correctly set or if your IP changes. Ensure you have FTP or hosting file manager access to revert changes if necessary.