Adding a New Layer of Security to your WordPress Installation using .htaccess IP Restrictions

Peace of mind over your WordPress website’s security can become an obsession when online perpetrators abound so much and brutally force their way in so what to do to make yourself a bit less worried?The simple answer:Making sure you,or a select few are the only person(s) able to log in.

While this is may cause management problems(if not,nightmares) on sites that bolster many users or authors, it is an extremely robust yet simple way to achieve high security clearance on your personal websites.

To resume:

You should do this if:

  1. You ,or only a few are the only users to log
  2. You,or the users that log have a Static IP*

*an IP that does not change over time i.e Cable internet

You should not do this if:

  1. You log on to the website from many locations(unless you add the different IP addresses to our new .htaccess rules)
  2. Many people,either Authors or Users,log on to the website.(In this case,I recommend plugins)
  3. You have a Dynamic IP*
*an IP that changes over time i.e aDSL

.htaccess Permissions Check

We’ll be working with two .htaccess files,one inside the wp-admin folder and the other in the root WordPress installation.The files can sometimes be invisible from Cpanel so the simplest way is to open the File Manager and check the “Display hidden files(.dot file)”.On some hosts,you might not be able to modify the file so check that out first to make sure you can proceed next.


Step 1:Creating a new WordPress Admin .htaccess rule and/or file

Inside your favorite notepad(I use Notepad++ on Windows),create a file called .htaccess and paste the following from the first line;


Order Deny,Allow
Deny from all
Allow from xx.xx.xx.xx


Where xx.xx.xx.xx is your IP address,Click Here to know yours.

Then Upload it to your ‘wp-admin’ directory.

Note:If you need to add several IP addresses,just add another ;

Allow from xx.xx.xx.xx

under yours.

Step 2: Modifiying the existing .htaccess in the Root WordPress Installation

Second is to add rules to the WordPress installation’s .htaccess.The file will either already exist or you will need to create it as you did with the other.The contents of the file should include the following rule block;

<Files wp-login.php>
 Order Deny,Allow
 Deny from all
 Allow from xx.xx.xx.xx

Where again xx.xx.xx.xx is your IP address.


Last Step: Making sure everything works

Last but not least,verify that you still can access the login page and confirm that you can not from another internet connection ,say your old 56k which uses dynamic IP’s or at another location.




13 Responses to Adding a New Layer of Security to your WordPress Installation using .htaccess IP Restrictions

  • Software says:

    I do not even know the way I stopped up right here, however I believed this submit was great. I don’t recognise who you’re but certainly you’re going to a famous blogger in the event you are not already. Cheers!

  • Ano says:

    Do you accept guest posts? I would love to write couple articles here.

  • Tyler says:

    Nice to read your blog

  • Slow Computer Solution says:

    I would like to thnkx for the efforts you’ve put in writing this website. I’m hoping the same high-grade site post from you in the upcoming as well. Actually your creative writing abilities has encouraged me to get my own web site now. Really the blogging is spreading its wings rapidly. Your write up is a good example of it.

  • Wordpess Addict says:

    Love the site,keep it up Ninjaman!

  • Samuel says:

    This is exactly an issue I need to find more information about, many thanks for the post.

  • Eavesdrop Cell Phone says:

    Hi there, just became aware of your blog through Google, and found that it’s truly informative. I am going to watch out for brussels. I will appreciate if you continue this in future. Numerous people will be benefited from your writing. Cheers!

  • creating a iphone app says:

    Wonderful blog! I found it while surfing around on Yahoo News. Do you have any tips on how to get listed in Yahoo News? I’ve been trying for a while but I never seem to get there! Thank you

  • Tom says:

    Wow, fantastic blog layout! How long have you been blogging for? you made blogging look easy. The overall look of your web site is excellent, let alone the content!

  • wordpress user says:

    Great web page, very good publishing th is without question complete

  • Izzykonto opinie says:

    Perfect design! Where did you get it?

Leave a Reply

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

Who am I

Hi my name is Stéphane,
I am a Digital Artist,Musician and Wordpress addict.I love creating compelling Wordpress themes that are visually tailored to my client's needs or previous HTML designs.Whether you want a Wordpress Blog to match your existing template or simply want a new custom Wordpress Theme just contact me I am meticulous and I love working with serious people with high requirements.


Copyright ©2011-2017 Intelligent Web Designer Wordpress Artist All rights reserved. Any redistribution or reproduction of part or all of the contents in any form is prohibited other than the following. 1)you may print or download to a local hard disk extracts for your personal and non-commercial use only, 2)you may copy the content to individual third parties for their personal use, but only if you acknowledge the website as the source of the material.You may not, except with our express written permission, distribute or commercially exploit the content. Nor may you transmit it or store it in any other website or other form of electronic retrieval system.

Privacy Policy XML-Sitemap