If WordPress is installed in a subdirectory like example.com/blog and you want it running at example.com instead, you don't need to reinstall anything. WordPress has a built-in setting for this: change the Site Address (URL) while leaving the WordPress Address (URL) pointing at the subdirectory, then move your index file up a level. No plugin required for most sites, though one exists if you'd rather not touch files directly.
Before you start
Take a backup first. This is a structural change and if a step goes wrong partway through, you want a clean point to return to. See Backing up your WordPress site for more on backups.
If the site is business-critical or you want to test the move without any live-site risk, do it on a staging copy first. See Using WordPress staging for the workflow.
The built-in method
WordPress separates two settings that people often assume are the same thing:
- WordPress Address (URL): where your WordPress core files actually live.
- Site Address (URL): what visitors type to reach your site.
Normally these match. To move to the root without moving every WordPress file, you set them differently on purpose.
- Log into
wp-adminand go to Settings → General. - Leave WordPress Address (URL) as
https://example.com/blog. - Change Site Address (URL) to
https://example.com. - Save. The admin area will look broken immediately after this step. That's expected, keep going.
Now move two files out of the subdirectory and into your site's root using File Manager (Services → your hosting → File Manager in the portal, or cPanel's File Manager tool):
- Copy
index.phpfrom/blog/to the root folder (usuallypublic_html). - Open the copied root-level
index.phpin the editor and find the line:require __DIR__ . '/wp-blog-header.php';
Change it to point back at the subdirectory:require __DIR__ . '/blog/wp-blog-header.php';
- Copy your
.htaccessfile from/blog/to the root as well, if you have custom rules in it. A fresh WordPress.htaccesswill otherwise regenerate with defaults.
Once both files are in place at the root, load https://example.com/wp-admin. You should be able to log back in normally, and the site should now serve from the root.
Fix permalinks last
Go to Settings → Permalinks and click Save Changes, even without editing anything. This forces WordPress to rewrite the rewrite rules in your root .htaccess against the new URL structure. Skipping this step is the most common reason people see 404s on every page except the homepage after a move like this.
If you'd rather use a plugin
A site-URL-change plugin from the WordPress repository automates the same file moves and search-replaces the site URL throughout the database, which matters if you have internal links, image paths, or serialized data referencing the old subdirectory path. For most brochure sites the built-in method above is enough since the URL itself isn't changing, only which directory serves it. For larger sites with years of hardcoded internal links in post content, a plugin that does a proper search-and-replace pass is worth the extra step.
Clean up old links
If anything external still links to example.com/blog/some-post, that URL will now 404 unless you redirect it. The cleanest fix is a rule in your root .htaccess that sends /blog/* traffic to the equivalent root path, placed above the WordPress block so it runs first.
When to contact support
If permalinks still 404 after saving them, or the admin area won't load after the file swap, open a ticket from Support in the portal. Include the exact URL structure you're moving from and to and the steps you've taken so far.