Set Correct WP-File Permissions A. Set 400 for wp-config.php file

Secure WP-Config File From Hackers Optional
A. Find your document_root path to paste (a) under <?php at the 2nd line on the wp-config.php file to check document_root path > copy the path Optional
B. Create a new wp-config.php file on the upper directory > copy and paste the old config code on the new wp-config.php file > copy the new wp-config.php path >use it on the old wp-config.php as the format of (b)
```php
// A:
echo phpinfo();
// B:
<?php
include("/home/hirendev/wp-config.php");
```

A. protect .htaccess
# protect .htaccess
<Files ~ "^.*\.([Hh][Tt][Aa])">
Order allow,deny
Deny from all
Satisfy all
</Files>
OR
B. Protect .htpasswd
# protect .htpasswd
<Files ~ "^.*\.([Hh][Tt][Pp])">
Order allow,deny
Deny from all
Satisfy all
</Files>
OR
C. Protect both files
# protect .htaccess and .htpasswd
<Files ~ "^.*\.([Hh][Tt])">
Order allow,deny
Deny from all
Satisfy all
</Files>
OR
D. Protect all files beginning with a dot
# protect all dot files
<Files ~ "^.*\.">
Order allow,deny
Deny from all
Satisfy all
</Files>

Protect wp-config.php file on .htaccess
# Protect wp-config.php file
<files wp-config.php>
order allow,deny
deny from all
</files>
How to Disable Directory Browsing in WordPress on .htaccess
#Disable Directory Browsing
Options All -Indexes
Block WordPress xmlrpc.php requests on .htaccess
# Block WordPress xmlrpc.php requests
<Files xmlrpc.php>
order deny,allow
deny from all
allow from 123.123.123.123
</Files>
Stop Brute Force by Blocking Author Scans in WordPress on .htaccess
# BEGIN block author scans
RewriteEngine On
RewriteBase /
RewriteCond %{QUERY_STRING} (author=\d+) [NC]
RewriteRule .* - [F]
# END block author scans
Protect individual files by .htaccess on .htaccess
# Protect individual file by .htaccess
<files .htaccess>
order allow,deny
deny from all
</files>
To prevent anyone from accessing any PHP files in the wp-content/uploads folder. you can create a .htaccess file in the wp-content/uploads folder and add the following code to it:
# Kill PHP Execution
<Files ~ ".ph(?:p[345]?|t|tml)$">
deny from all
</Files>
Protect the wp-content directory. The author suggested creating a separate .htaccess file inside the wp-content folder. The suggested snippet looks like this:
# Wp-content access deny
order deny,allow
deny from all
<files ~ ".(xml|css|jpe?g|png|gif|js)">
allow from all
</files>
Use just Simple Login Captcha (no need to configure)
Install the Solid Security plugin and set basic settings