Skip to content

WPcademy

Linux & Wordpress Tutorials

  • Home
  • WordPress
    • WordPress Login
    • WordPress Hosting
    • WordPress Plugins
    • WordPress SEO
    • WordPress Themes
    • WordPress Tutorials
  • Linux Tutorials
    • Centos
    • Ubuntu
  • Tutorials
    • How to
    • Programming
  • Security
  • About Us
  • Contact Us

Tag: limit wordpress access by ip address

Posted on October 17, 2019

How to Limit Access by IP in WordPress

As a security measure, we decided to limit access by IP to our wp-login.php file in WordPress. We already have our WP Admin directory on limited access by IP. In this article, we will show you how to limit access by IP to your wp-login.php file in WordPress.

Note: This tutorial is for advance user.

Open your main .htaccess file and put this code towards the top of the file before everything else.

<Files wp-login.php>
        order deny,allow
        Deny from all
# whitelist the following IP address
allow from xx.xxx.xx.xx
#whitelist Gainesvile IP Address
allow from xx.xxx.xx.xx
</Files>

Don’t forget to replace the IP addresses with your own. The only real downside to this is if you have dynamic IPs, then it can be a problem. Otherwise, this works like charm. Also, the wp-login.php styling breaks, but that is not a priority at this moment. We just wanted to prevent the failed login attempts.

You Might Also Like: Optimize Your WordPress Robots.txt for SEO

100 dollar free credit on digitalocean cloud server

Latest Tutorials

  • How to install and configure shadowsocks in ubuntu machine
  • Initial Server Setup with Ubuntu
  • How to connect to a remote MySQL database using Linux terminal
  • How To Install OpenEMR on Ubuntu 20.04 with a LAMP Stack (Apache, MySQL, PHP)
  • How to Install WordPress with LEMP on Ubuntu 20.04
  • How To Use Traefik v2 as a Reverse Proxy for Docker Containers on Ubuntu 20.04
  • How To Set Up Physical Streaming Replication with PostgreSQL 12 on Ubuntu 20.04
  • How To Install PostgreSQL on Ubuntu 20.04 [Quickstart]
  • How To Serve Flask Applications with Gunicorn and Nginx on Ubuntu 20.04
  • How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 20.04
  • Facebook
  • YouTube
Privacy Policy Proudly powered by WordPress