Making WordPress store its files in a secret folder

Do you want to install WordPress on your server but want to keep your root directory clean?

The easiest way to do this is just to install the files for WordPress into a subdirectory, change the site address to the root, and then copy the index.php up to the root, and then edit one line to reference the new WordPress subdirectory.

require( dirname( __FILE__ ) . '/wp-blog-header.php' );

becomes

require( dirname( __FILE__ ) . '/subdirectory/wp-blog-header.php' );

For more info, check out the official WordPress documentation https://codex.wordpress.org/Giving_WordPress_Its_Own_Directory

Leave a Reply

Your email address will not be published. Required fields are marked *