How do I move WordPress from a subfolder to the root domain? Print

  • 0

You can serve a WordPress install from a subfolder (like /blog) at the root without moving files.

  1. In Settings > General, leave WordPress Address (URL) as https://yourdomain.com/blog but change Site Address (URL) to https://yourdomain.com.
  2. Copy the index.php and .htaccess files from your subfolder to your public_html root.
  3. Edit the copied index.php and change the require line to point to your subfolder, e.g. require __DIR__ . '/blog/wp-blog-header.php';

Save, then visit the root domain. If you prefer to physically move files into public_html, back up first and run a search-replace afterward. Clear your cache when done. Stuck? Open a ticket.


Was this answer helpful?

« Back