If you’re searching for how to move WordPress root directory files from /blog to the main domain, the process is easier than it first appears. You need a full backup, access to your hosting files, and the right URL changes in WordPress.

The basic order matters: back up the site, move every WordPress file into the document root, update both WordPress URLs, refresh permalinks, and test every important page. We recommend taking your time here. A careful move protects your content, rankings, forms, and customer experience.

Why Move WordPress From a Subfolder?

WordPress often starts in a folder such as public_html/blog, while visitors access the site at example.com/blog. That setup works, but it may not fit the way you want your business website to appear.

Moving the installation to the root changes the public address to example.com. Your homepage no longer includes the subfolder, and new pages use cleaner paths such as example.com/services instead of example.com/blog/services.

The move can make your site structure easier to manage, especially if WordPress is the main website on the domain. It can also remove confusion when you share links, set up analytics, or connect marketing tools.

WordPress files and the public website address are connected, but they aren’t the same thing. The official WordPress directory guide explains how WordPress files can live in one location while visitors see another URL.

Before you change anything, confirm that the root folder is the right destination. Depending on your hosting account, it may be named public_html, www, htdocs, or a folder linked to the domain.

Prepare the Site Before You Move Anything

A WordPress move is a file and URL change, not a new installation. Your database usually stays where it is. Still, we recommend preparing a complete copy of both the files and database before touching the live site.

Export the database through your hosting control panel, phpMyAdmin, or your regular backup system. Download the entire WordPress directory too, including wp-content, wp-admin, wp-includes, wp-config.php, .htaccess, and hidden files.

Keep the backup somewhere outside your hosting account. If a failed move damages the live files and the only backup sits on the same account, recovery becomes much harder.

Laptop showing a website structure diagram on a modern desk.

Before continuing, write down these details:

  1. Record the current WordPress Address and Site Address under Settings > General.
  2. Note your database name, database user, table prefix, and hosting login.
  3. Check whether the root folder already contains another website or an index.php file.
  4. Clear or pause caching while you work, including plugin, server, and CDN cache.
  5. Schedule the move during a quiet period if the site receives orders, bookings, or contact requests.

If another website already occupies the root directory, don’t move WordPress over it. Make a separate plan for that site first, or ask your host to confirm which folder belongs to your domain.

How to Move WordPress Root Directory Files

Once your backup is ready, open your host’s File Manager or connect through FTP. cPanel users will usually find the tool inside cPanel. Other hosts may use a custom panel with similar file controls.

Open the folder where WordPress currently lives. For example, it might be public_html/blog. Then move the files inside that folder into the domain’s document root.

A computer screen showing folders in a dark file manager interface.

Follow this sequence:

  1. Open the WordPress subfolder and select everything inside it.
  2. Include hidden files, especially .htaccess, if your file manager hides them by default.
  3. Choose Move, then set the destination to the root folder, such as public_html.
  4. Confirm that folders including wp-admin, wp-content, and wp-includes now sit directly inside the root.
  5. Check that index.php, wp-config.php, and .htaccess are also in the root.
  6. Leave the old folder in place until the new site works correctly.

Don’t move only the wp-content folder. Don’t copy only index.php unless you’re deliberately using a different WordPress directory setup. A full move needs the complete WordPress file set.

If the file manager asks whether to overwrite an existing file, stop and check what is already in the destination. Overwriting a live site’s index.php or .htaccess can take down another website. The manual WordPress subfolder migration guide also covers file transfer options through hosting tools.

Update Both WordPress URL Settings

After the files reach the root, open the WordPress login page at the new address, usually:

https://example.com/wp-admin

If WordPress redirects you back to the old subfolder, use the recovery options below before trying again.

In the dashboard, go to Settings > General. You should see two fields:

  • WordPress Address (URL) points to the location of the WordPress core files.
  • Site Address (URL) controls the address visitors use to reach the website.

For a full move to the root, remove the subfolder from both fields. Change:

https://example.com/blog

to:

https://example.com

Save the changes. WordPress may log you out and send you to the new login address. That’s expected.

Both URL fields must point to the same final domain when all WordPress files have moved into the root. Changing only one field can create redirects, missing styles, or login problems.

If you can’t reach the dashboard, add or edit the URL constants in wp-config.php with your hosting File Manager. Use the final root address for both WP_HOME and WP_SITEURL. If those constants already exist, edit them instead of adding duplicates.

Another recovery option is phpMyAdmin. In the WordPress options table, update the home and siteurl values to the root domain. The table may have a custom prefix, so don’t assume it is named wp_options.

Refresh Permalinks and Replace Old URLs

Once the new root URL works, go to Settings > Permalinks and click Save Changes. You don’t need to change the permalink structure. Saving the page refreshes WordPress rewrite rules and often fixes broken page URLs.

The main URL settings don’t update every old reference stored in your database. Images, menu links, buttons, plugin settings, and post content may still contain /blog.

Run a search and replace for the old full URL and the new root URL. Use a WordPress migration tool or a command that understands serialized data. A basic database-wide text replacement can damage serialized settings, so don’t run a blind SQL replacement.

The WordPress subdirectory installation guide provides helpful context on the relationship between directory paths and public URLs. That distinction matters when you repair old links after the move.

Search for both versions of the old address:

  • https://example.com/blog
  • http://example.com/blog

If your site recently switched to HTTPS, check for both protocols. Replace old paths in menus, widgets, theme settings, forms, and SEO plugin fields.

Test the Site Before Removing the Old Folder

A homepage loading correctly doesn’t prove the move is complete. Test the site as a visitor and as an administrator.

Open a private browser window, then check:

  • The homepage and several pages
  • Blog posts, categories, and tags
  • Images, PDFs, and downloadable files
  • The new /wp-admin login
  • Contact forms, checkout pages, and newsletter forms
  • Navigation menus and footer links
  • Search results and pagination
  • SSL security and browser warnings
  • XML sitemap and robots.txt
  • Caching and mobile layouts

If pages show 404 errors, save the permalink settings again. If images are missing, check their URLs in the database and media library. If the site redirects repeatedly, review the URL fields, wp-config.php, caching rules, and .htaccess.

You should also create 301 redirects from the old subfolder URLs to their new root paths. For example, an old /blog/contact address may need to redirect to /contact. Test a few old URLs manually before adding a broad rule.

Don’t delete the old subfolder immediately. Keep the backup and old files until you’ve confirmed that important pages, forms, and search traffic work normally.

Move to Hosting That Makes WordPress Easier

A directory move is also a good time to ask whether your current hosting makes routine WordPress work harder than it should.

At ZADiC, our cPanel and WordPress hosting gives you familiar file tools, one-click setup, free SSL on many plans, security monitoring, and 24/7 human support. That means you can handle a move with clear access to your files, or get help when a redirect or database issue appears.

If your site is growing, managed Web Hosting Plus and VPS options provide more room for traffic, plugins, and business tools. You don’t need to wait for a major outage to choose a more dependable setup. Good hosting gives you a stable place to build, update, and grow.

Keep the Move Clean and Controlled

To move WordPress from a subfolder to the root, back up the files and database first. Then move the complete WordPress installation into the correct document root, update both URL settings, refresh permalinks, replace old subfolder references, and test the site carefully.

The most common mistakes are simple: moving only part of the installation, overwriting another site, changing one URL instead of both, or skipping the database search and replace.

Take those risks out of the process, and the move becomes a controlled change instead of a stressful rebuild. A reliable host and a complete backup give you the confidence to put your WordPress site where it belongs.

We use cookies so you can have a great experience on our website. View more
Cookies settings
Accept
Decline
Privacy & Cookie policy
Privacy & Cookies policy
Cookie name Active

Who we are

Our website address is: https://zadic.net.

Comments

When visitors leave comments on the site we collect the data shown in the comments form, and also the visitor’s IP address and browser user agent string to help spam detection. An anonymized string created from your email address (also called a hash) may be provided to the Gravatar service to see if you are using it. The Gravatar service privacy policy is available here: https://automattic.com/privacy/. After approval of your comment, your profile picture is visible to the public in the context of your comment.

Media

If you upload images to the website, you should avoid uploading images with embedded location data (EXIF GPS) included. Visitors to the website can download and extract any location data from images on the website.

Cookies

If you leave a comment on our site you may opt-in to saving your name, email address and website in cookies. These are for your convenience so that you do not have to fill in your details again when you leave another comment. These cookies will last for one year. If you visit our login page, we will set a temporary cookie to determine if your browser accepts cookies. This cookie contains no personal data and is discarded when you close your browser. When you log in, we will also set up several cookies to save your login information and your screen display choices. Login cookies last for two days, and screen options cookies last for a year. If you select "Remember Me", your login will persist for two weeks. If you log out of your account, the login cookies will be removed. If you edit or publish an article, an additional cookie will be saved in your browser. This cookie includes no personal data and simply indicates the post ID of the article you just edited. It expires after 1 day.

Embedded content from other websites

Articles on this site may include embedded content (e.g. videos, images, articles, etc.). Embedded content from other websites behaves in the exact same way as if the visitor has visited the other website. These websites may collect data about you, use cookies, embed additional third-party tracking, and monitor your interaction with that embedded content, including tracking your interaction with the embedded content if you have an account and are logged in to that website.

Who we share your data with

If you request a password reset, your IP address will be included in the reset email.

How long we retain your data

If you leave a comment, the comment and its metadata are retained indefinitely. This is so we can recognize and approve any follow-up comments automatically instead of holding them in a moderation queue. For users that register on our website (if any), we also store the personal information they provide in their user profile. All users can see, edit, or delete their personal information at any time (except they cannot change their username). Website administrators can also see and edit that information.

What rights you have over your data

If you have an account on this site, or have left comments, you can request to receive an exported file of the personal data we hold about you, including any data you have provided to us. You can also request that we erase any personal data we hold about you. This does not include any data we are obliged to keep for administrative, legal, or security purposes.

Where your data is sent

Visitor comments may be checked through an automated spam detection service.
Save settings
Cookies settings