Restrict 🚫 wp-admin to specific IP address

Restrict 🚫 wp-admin to specific IP address

To restrict access to the WordPress admin area (wp-admin) create a new file .htaccess inside your wp-admin folder and put the following code snippet:

order deny, allow
allow from 123.456.7.8
deny from all

Replace 123.456.7.8 with your IP.

You can check your public IP address here.

whoami
Stefan Pejcic
Join the discussion

I enjoy constructive responses and professional comments to my posts, and invite anyone to comment or link to my site.