Block Access to WordPress WP-Admin

If you are care about your wordpress, you can refer to my tutorial to protect your wordpress admin by allow login use your own ip or vpn. This is one of many ways to protect and lock down your WordPress dashboard from unauthorized access or hackers who might want to hack into your WordPress admin site.

Please refer video below how to protect your wordpress like me.

As soon as you understanding how to work with nginx, open the WordPress site configuration file and add the below block of code into the file and save it.

            location ~ ^/(wp-admin|wp-login\.php) {
                    allow 116.XXX.XXX.XXX;
                    allow 104.XXX.XXX.XXX;
                    allow 98.XXX.XXX.101;
                    deny all;
                    error_page 403 = @wp_admin_deny;
            }
            location @wp_admin_deny {
                    rewrite ^(.*) https://www.levelcore.com permanent;
            }
            location /wp-admin/admin-ajax.php {
                    allow all;
            }

About levelcore

Leave a Reply

Your email address will not be published. Required fields are marked *