1

How to Secure WordPress Website Security

Why Website Security is Important?

UnivaHost

Last Update 3 年前

A hacked WordPress site can cause serious damage to your business revenue and reputation. Hackers can steal user information, passwords, install malicious software, and can even distribute malware to your users.


Worst, you may find yourself paying ransomware to hackers just to regain access to your website.

Best .htaccess Snippets to Improve WordPress Security

What is the .htaccess file?

An htaccess file is an optional configuration file for the Apache web server to interpret, for each directory. You can store various settings in that file such as: password protect a directory, block IPs, block a file or folder from public access, etc. Traditionally, the .htaccess file is present in the base WordPress installation directory. It stores the permalink structure by default.

1. Block Bad Bots

One of the best uses of the .htaccess file is its ability to deny multiple IP addresses from accessing your site. This is useful when blocking known spammers and other origins of suspicious or malicious access. The code is:

2. Disable Directory Browsing

3. Allow Only Selected Files from wp-content

4. Restrict All Access to wp-includes

5. Allow only Selected IP Addresses to Access wp-admin

6. Protect wp-config.php and .htaccess from everyone

7. Deny Image Hotlinking

Was this article helpful?

4 out of 4 liked this article

Still need help? Message Us