wp-config.php file is one of the most important core WordPress file in which our database configuration and other information are stored. WordPress has default structure and every WordPress developer knows wp-config.php file is located in root folder. So for security purpose it’s better to move wp-config.php file to custom location where hacker can’t reach.
Follow the below steps to move wp-config.php file to custom location:
Step 1 : Open your WordPress folder and find wp-config.php file available in root folder.
Step 2: Create custom folder in which later we will move our wp-config.php file
Step 3: Copy wp-config.php file from root folder and paste into newly created folder.
Step 4: Open wp-load.php file from WordPress root folder and search below code.
and replace with this: