Moving wp-config.php: Can this be done after site launch?

For additional security, the suggestion is made to move the wp-config.php up one level. Can this be done after the site has already been launched? Any potential issues in doing this? Are there an restrictions/suggestions on what the new folder should be called?

Related posts

Leave a Reply

3 comments

  1. You can safely move it as far as I know…. but what do you mean folder?

    Up one level would already be a folder….

    if your site is in html, or public_html or whatever, you place the wp-config file in whatever folder holds your html or public_html folder

    like if your path is /home/content/u/s/e/user/html/

    And your WP is in html, the wp-config would go in user, the next folder up which is not web accessible. WP will automatically look for it there

    If you are on shared hosting, you probably can’t do that anyway

    And if you have WP in a subdirectory, there would be no point in moving wp-config, as moving it up a level would still put it in a web accessible directory

  2. Can this be done after the site has already been launched?

    Yes.

    Any potential issues in doing this?

    No (that I can think of).

    Are there an restrictions/suggestions on what the new folder should be called?

    You should not create any new folders. Simply move file up one level. For example if your current path is /home/username/public_html/wp-config.php you should move it to /home/username/wp-config.php

  3. You can safely move wp-config.php up one directory from the base WordPress install. You don’t need to “name” any directories anything differently, as the relevant directory already exists. Also, WordPress core is already coded so that it looks in its root directory, and then one directory higher, for wp-config.php.