On some of my WordPress installations, usually for larger sites or sites that already have a lot of folders and files, I choose to install WordPress in another directory.
This may be something you may want to consider if you just want to keep things neat and organized on your server.
First things first, back up all of your files before you do anything else.
1. Install WordPress as you normally would, but instead of installing it in the blog’s root directory, install it in the folder you want to use as your back end – like “admin” or “wp”, etc.
2. Once you’ve completed your installation of WordPress, login to the admin panel and from the Options -> General tab, you’ll need to set your WordPress address to the folder you installed WordPress (without the trailing slash) and set the Blog address to your blog’s root address (without the trailing slash).
3. In a text or HTML editor, open the
index.php file and change the location of your
wp-blog-header.php to the new location.
Example: if your WordPress installation folder is ‘admin’,
<?php require('./wp-blog-header.php'); ?> becomes
<?php require('./admin/wp-blog-header.php'); ?>
4. Upload the edited index.php to your blog’s root directory (i.e. not the ‘admin’ folder) and delete the index.php file from your WordPress directory (i.e. the ‘admin’ folder) or set it to redirect to the root.
5. If you’re using permalinks or other rewrite rules, the .htaccess file needs to be in the same location as the index.php file (i.e. not the ‘admin’ folder)
Remember that your login and registration links will change. Where you used to visit http://www.yoursite.com/wp-login.php, the location will now be http://www.yoursite.com/admin/wp-login.php.
People should still be able to visit your blog’s homepage and see everything as they normally would, and you have a neat WordPress folder behind the scenes.
Special Note for WP 2.5+ Users: Some of the nomenclature for the WordPress admin panel has changed. Options has now become Settings.