How to Move WordPress from a Subdirectory to the Root Directory

Have you installed WordPress in a subdirectory like yourdomain.com/blog but now want it to appear directly at yourdomain.com? You are not alone! Many site owners start their site in a subfolder and later decide to move it to the main root directory for better branding, SEO, or usability.

This guide will show you step-by-step how to safely move WordPress from a subdirectory to your root directory, without breaking your website.

What You Need Before You Start

  • Access to your cPanel/File Manager or FTP client

  • Backup plugin (like UpdraftPlus, All-in-One WP Migration)

  • Access to your WordPress admin dashboard

  • Time: ~20–30 minutes

Step-by-Step Guide

Step 1: Backup Your Website (Important!)

Before doing anything, take a full backup of your website (files + database).

Step 2: Copy Files from Subdirectory to Root

  1. Log into your File Manager (via cPanel) or use FTP.

  2. Navigate to /public_html/blog/ (or whatever your subdirectory is).

  3. Select all files, including .htaccess and move/copy them to /public_html/.

Important: Do NOT delete the files in the subdirectory until the new root setup is confirmed to work.

Step 3: Update WordPress Settings (Dashboard)

  1. Log in to your WordPress Dashboard (still using yourdomain.com/blog/wp-admin)

  2. Go to Settings > General

  3. Change both:

    • WordPress Address (URL): https://yourdomain.com

    • Site Address (URL): https://yourdomain.com

  4. Click Save Changes

Step 4: Fix Permalinks

  1. Log back into your WordPress admin panel — now at yourdomain.com/wp-admin

  2. Go to Settings > Permalinks

  3. Click Save Changes to refresh your permalink structure.

Step 5: Update .htaccess File (Optional but Recommended)

Check that your .htaccess in the root directory has correct rewrite rules. A typical .htaccess looks like this:

Update Links and Media (Optional)

If you used absolute URLs linking to /blog/, use a plugin like Better Search Replace to update them.

  • Search: yourdomain.com/blog/

  • Replace with: yourdomain.com/



Test Everything!

Visit your homepage (yourdomain.com)
Test navigation links
Check images, forms, and plugins
Try logging into yourdomain.com/wp-admin

Can I Just Delete the Subdirectory Now?

Once you’re 100% sure everything works, you can safely delete the old subdirectory — but keep your backup just in case.

That’s it! You have successfully moved your WordPress site from a subdirectory to the root directory. This change can give your site a more professional appearance and boost SEO friendliness.

If you’re unsure or need help, consider reaching out to a web developer or your hosting support.

Watch a video below for detail of it: