Complete Guide on Moving WordPress Core Files into Root Directory

No votes yet.
Please wait...

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, to or something else).

This will not affect your blog link, after all your blog link will be the same as 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.

A Complete Guide on Moving the WordPress Core files into Root Directory

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 (

Moving WordPress Core files into a DIrectory

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.

Setting up Permalinks

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 URLsand follow these steps:

1. Goto Settings > Update URLs

2. Add this URL as old:

3. Add this URL as new:

4. Save Settings.

Yep, you can enjoy blogging now with your new login page (

Thanks for reading.

Similar Posts


  1. Hi Muhammad, Assalamu alaikum. This is a great post with clear steps to do the move – thank you very much. I executed the move yesterday by moving my wordpress installation from root to a directory named ‘blog’. I have 2 questions:

    1. You mentioned that I should update permalinks. Does that mean that I prefix the directory ‘blog’ in all my permalinks. Previously I was using postname as the permalink. Now I have to make it custom with the word ‘blog’. Is there any way to avoid having the directory name in all my permalinks?

    2. I am using bluehost – there were many files there in the root directory that did not start with wp. I moved all of them including the folder cgi-bin. Is this right or wrong?

    I would appreciate your response

    No votes yet.
    Please wait...
      Walaikum Assalam, at first I welcome you… Secondly the answers of your questions are as follows:

      1. The updating permalinks doesn’t mean that you got to change the prefix in the URL as “blog” however, it’ll automatically the changed with your blog prefix just after updating. As mentioned that (This will automatically updated in .htaccess)…

      2. You only should move the files and folders that starts from wp- not all that including cgi-bin…

      Hope, you would be able to move your WordPress installations into a root directory… BTW Thanks for the comment.

      No votes yet.
      Please wait...
  2. I just install it to my root directory of ODosta but I cannot change my image path to root directory. please tell me how I can do it.

    No votes yet.
    Please wait...
    1. If you have set the permalinks correctly then you need to redirect the media files using Velvet Blues Update plugin.

      Here is how you can do it:

      1. Install and activate the plugin, goto Settings > Update URLs

      2. Add this URL as old:

      3. Add this URL as new:

      4. Save Settings.

      No votes yet.
      Please wait...

Leave a Reply

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