Inserting some commands in the .htaccess file of your WordPress site can greatly improve its security.
We specify below some typical commands, it being understood that the choice to implement each measure is subjective and must be evaluated case by case.
You can use below code to secure your wordpress application. You just have to add them in your .htaccess file.
You can add below code to restrict access of wp-config.php file:
You can add below code to restrict access of xmlrpc.php file:
You can add below code to restrict access of admin-ajax.php file
We specify below some typical commands, it being understood that the choice to implement each measure is subjective and must be evaluated case by case.
You can use below code to secure your wordpress application. You just have to add them in your .htaccess file.
You can add below code to restrict access of wp-config.php file:
Code:
<files wp-config.php>
order allow,deny
allow from 127.0.0.1
deny from all
errordocument 403 "This file is forbidden"
</files>
Code:
<files xmlrpc.php>
order allow,deny
allow from 127.0.0.1
deny from all
errordocument 403 "This file is forbidden"
</files>
Code:
<files admin-ajax.php>
order allow,deny
allow from 127.0.0.1
deny from all
</files>