Skip to main content

How to protect or make more secure your wordpress website

How to protect or make more secure your wordpress website


As you read the title, you are probably wondering isn’t the wp-admin directory already password protected. You are required to login right. Well that is true, but to add an additional layer of security popular sites often add an extra layer of authentication. Few days ago, we started seeing some suspicious activity on WPBeginner, so our host HostGator advised us to password protect our WordPress admin directory. Apparently popular sites like Mashable do the same. In this article, we will show you a step by step guide on how to password protect your WordPress admin (wp-admin) directory.

To keep things easy and simple, we will only cover cPanel web hosting companies here just because cPanel has an easy enough interface to add password protected directories.

Login to your cPanel. Scroll down till you see the Security Tab. Click on the “Password Protect Directories” icon.

When you click on that, a lightbox popup will show up asking for directory location. Just click on web root. Once you are there, navigate to the folder where your WordPress is hosted. Then click on the /wp-admin/ folder. You will see a screen like this:


Simply check the box to password protect the directory. Then create a user for the directory. That is it. Now when you try to access your wp-admin directory, you should see an authentication required box like this:

Manual Method

First create a .htpasswds file. You can do so easily by using this generator. Upload this file outside your /public_html/ directory. A good path would be:

home/user/.htpasswds/public_html/wp-admin/passwd/

Then, create a .htaccess file and upload it in /wp-admin/ directory. Then add the following codes in there:

AuthName "Admins Only"
AuthUserFile /home/yourdirectory/.htpasswds/public_html/wp-admin/passwd
AuthGroupFile /dev/null
AuthType basic
require user putyourusernamehere

You must update your username in there. Also don’t forget to update the AuthUserFile location path.

I have a 404 Error or a Too many redirects error

Well this can happen depending on how your server is configured. To fix this issue, open your main WordPress .htaccess file and add the following code there before the WordPress rules start.
1
ErrorDocument 401 default
Well there you have it. Now you have double authentication for your WordPress admin area. This is a good alternative to limiting wp-admin access by IP address.
Update: Here is how to fix the Admin Ajax Issue
If you password protect your WordPress Admin directory, then it will break the Ajax functionality in the front-end (if it is being used). In our case, we don’t have any plugins that is using ajax in the front-end. But if you do, then here is how you fix that issue.
Open the .htaccess file located in your /wp-admin/ folder (This is NOT the main .htaccess file that we edited above).
In the wp-admin .htaccess file, paste the following code:
<Files admin-ajax.php>
    Order allow,deny
    Allow from all
    Satisfy any
</Files>

Comments

Popular posts from this blog

5 ways to make better and impressive meetings

Meetings come in all shapes and sizes. There are board meetings, stakeholder meetings, staff meetings, sales meetings — the list is endless. But no matter the purpose, every meeting has one thing in common: how clients, customers and stakeholders perceive you can directly determine the outcome. Months of hard work and tireless effort could all go to waste if you aren’t able to pitch an audience your company’s latest idea, project or venture. Here are five ways to run a successful business meeting and ensure you always leave a positive impression. 1. Measure the mood. If you want your meeting attendees to leave impressed, make sure you exceed their expectations. One way of going above and beyond — without anyone even realizing it — is to take a mental note of the mood of each person as they arrive and sit down. Use a basic scale of 1–10; the lower the number, the more unhappy or irritated the person appears. Then use that information to tailor your actions throughout the meetin

Tappay payment gateway integration woocommerce

TapPay  offers fast  payment  flow integration, allowing your customers to  pay  with a click of a button instead of redirecting to other websites, in this article you will see how you can integrate  Tappay payment gateway with woocommerce . how you get  Tappay payment gateway woocommerce module and integrate it. When it comes to data security,  TapPay is also very safe and reliable . TapPay provides friendly and flexible payment service, which allows citiesocial users to enjoy wonderful shopping experience.It has a significant impact on improving e-commerce conversion rate and lower operation cost. Tappay payment gateway integration woocommerce Tappay payment gateway integration woocommerce Integrated Payments Exclusive Cross-site modules for seamless checkout experiences Tokenized card management, Card-Free experience and self-updating card expiration dates TapPay is compatible with multiple payment method and E-wallet, including Apple Pay / Google Pay / Samsung Pay / LINE Pay / JKOP

Icici eazypay Payment gateway integration with woocommerce plugin php module

Icici eazypay Payment gateway integration with woocommerce plugin php module Icici eazypay Payment gateway integration with woocommerce plugin php module,  What is the icici eazypay? eazypay lets you pay your bills conveniently, be it your education, housing society maintenance or any other bills. You can pay your bills using Cash Deposit, Cheque Deposit, RTGS, NEFT, Net Banking or Cards. Why eazypay? Search bills with your registered  Mobile Number/Email ID Enjoy multiple payment options Get reminder before due date Pay from any of your Bank Accounts Pay bills of large number of Institutions Get e-Receipts for payments made Icici eazypay Payment gateway integration with woocommerce plugin php module Eazypay is a single platform for multiple collection modes which facilitates single Management Information System (MIS) reconciliation for all collection modes. It has a plug and play implementation and enhances speed of collection. Eazypay is