Transferring the WordPress core files into a root directory is one of the best way to secure your blog in case of being hacked. Today, we’ll take a look on how to move your WP core files into root directory like (from www.yourdomain.com/wp-admin, to www.yourdomain.com/blog-files/wp-admin or something else).
This will not affect your blog link www.yourdomain.com/blog-files, after all your blog link will be the same as www.yourdomain.com. If you are using permalinks that’s okay, we’ll also redirect the permalinks for your blog posts’ media files (from wp-content/uploads/ to root-directory/wp-content/uploads/). Alright.
Step by Step Guide on Moving WordPress Core Files to Root Directory
Let’s get in.
1. Login to your blog, goto Settings > General enter the WordPress Address URL (http://www.yourdomain.com/your-directory-here).
2. Click the button save changes.
Hint: don’t run your blog for now.
3. Secondly, login to your cpanel > File Manager.
4. If you are using multiple domains using the same hosting account then goto the root directory of the one blog for whom you’re trying to move the WordPress core files into another root directory.
5. Here, make a folder with the same directory which you’ve used in your WordPress Address URL before in the first step.
6. Finally, move all the wp- extension files and folders into the directory which you have just created in the step 5.
7. Edit up the index.php file from the main directory of your blog. Further see the following file for better understandings.
8. Save the file index.php and try running your blog now.
Congratulations we’ve done moving the WP core files into another root directory.
You should be happy that you are using WordPress, it makes a lot more easier to your blog, and don’t let you edit a couple of code.
1. If your blog is using permalinks, then goto Settings > Permalinks and update your permalinks once. This will automatically edit up your .htaccess.
Redirecting Media Files
You don’t need to upload all of your media files again because here is a very great plugin which will let you redirect all your files/folder at once. Just install and activate this plugin Velvet Blues Update URLs, and follow these steps:
1. Goto Settings > Update URLs
2. Add this URL as old: http://www.yourdomain.com/wp-content
3. Add this URL as new: http://www.yourdomain.com/your-directory-here/wp-content
4. Save Settings.
Yep, you can enjoy blogging now with your new login page (yourdomain.com/your-directory-here/wp-admin).
Thanks for reading.