{"id":646,"date":"2023-07-24T05:45:56","date_gmt":"2023-07-24T05:45:56","guid":{"rendered":"https:\/\/blog.hostinger.io\/support\/2023\/07\/24\/8165530-how-to-move-a-wordpress-website-from-a-subdomain-to-the-root-domain-in-hostinger\/"},"modified":"2026-05-08T13:01:53","modified_gmt":"2026-05-08T13:01:53","slug":"8165530-how-to-move-a-wordpress-website-from-a-subdomain-to-the-root-domain-in-hostinger","status":"publish","type":"post","link":"https:\/\/www.hostinger.com\/support\/8165530-how-to-move-a-wordpress-website-from-a-subdomain-to-the-root-domain-in-hostinger\/","title":{"rendered":"How to Move a WordPress Website from a Subdomain to the Root Domain in Hostinger"},"content":{"rendered":"<p class=\"no-margin\">If you wish to <b>move your website from a subdomain to the root domain<\/b> (<code>subdomain.domain.tld<\/code> &rarr; <code>domain.tld<\/code>), follow the steps below &#128071; <\/p><div class=\"intercom-interblocks-callout\" style=\"background-color: #e3e7fa80;border-color: #334bfa33\">\n<p class=\"no-margin\">First, make sure the <b>root domain<\/b> is <b><a href=\"\/support\/1583214-how-to-add-a-website\" target=\"_blank\" class=\"intercom-content-link\">added to your hosting plan<\/a><\/b> &ndash; it should be visible in the <b><a href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Websites<\/a> <\/b>section of hPanel<b> &#128161; <\/b><\/p>\n<\/div><p class=\"no-margin\">\n<\/p><h2 id=\"h_d22228da82\">Step 1 &ndash; Copy Files From the Subdomain to the Root Domain<\/h2><p class=\"no-margin\">1. In the <b><a href=\"https:\/\/hpanel.hostinger.com\/websites\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Websites<\/a><\/b> section, click on<b> Manage<\/b> next to your website that&rsquo;s connected to the subdomain. <\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">2. In the left sidebar, search for <b>File Manager<\/b> and <b>access all the files within your hosting plan<\/b>:<\/p><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">3. Open the <b>domains <\/b>folder, then open the <b>folder of your website<\/b> (e.g., <code>subdomain.domain.tld<\/code>),<b> <\/b>and then open the<b> public_html<\/b> folder within:<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/07\/06e8d441-050d-4ce8-9698-df2e1221d8a0.jpg\" alt=\"Hostinger file manager showing domains &gt; subdomain.domain.tld &gt; public_html folder path highlighted\" data-media-id=\"2846\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">3. Select all the files, and <b>copy them to the root domain<\/b> (make sure its folder is empty):<\/p><p class=\"no-margin\">\n<\/p><div class=\"intercom-container intercom-align-center\"><img decoding=\"async\" src=\"\/support\/wp-content\/uploads\/sites\/55\/2023\/07\/02fec513-6845-449f-9d91-87bc93e02506.jpg\" alt=\"Hostinger file manager copy dialog with public_html selected and Copy button highlighted\" data-media-id=\"2849\"><\/div><p class=\"no-margin\">\n<\/p><p class=\"no-margin\">To choose the correct destination folder (e.g., <code>domain.tld<\/code>), <b>click on the .. icon<\/b> to go to the parent folder as many times as you need. Learn more: <b><a href=\"\/support\/4548688-basic-actions-in-the-file-manager\" target=\"_blank\" class=\"intercom-content-link\">Basic Actions in the File Manager<\/a><\/b> &#128161; <\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_1b5275b5db\">Step 2 &ndash; Connect the Database<\/h2><p class=\"no-margin\">There are two options to choose from:<\/p><p class=\"no-margin\">\n<\/p><h4 id=\"h_a630a4a280\">Option 1 <\/h4><p class=\"no-margin\">If you wish <b>for the subdomain to remain active<\/b>, duplicate the database and connect the new database to your website:<\/p><ol>\n<li>\n<p class=\"no-margin\"><b><a href=\"\/support\/5981435-how-to-download-backups-at-hostinger\" target=\"_blank\" class=\"intercom-content-link\">Download a backup<\/a><\/b> of your original website&rsquo;s <b>database<\/b> <\/p>\n<\/li>\n<li>\n<p class=\"no-margin\"><b><a href=\"\/support\/1583542-how-to-create-a-new-mysql-database\" target=\"_blank\" class=\"intercom-content-link\">Create a new database<\/a><\/b> for your new website (that&rsquo;s on the root domain)<\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Import the database backup to the new website <\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Update the <b><a href=\"\/support\/1583552-how-to-find-your-mysql-database-details\" target=\"_blank\" class=\"intercom-content-link\">database details<\/a><\/b> (name, username, password) in the <b>wp-config.php<\/b> file<\/p>\n<\/li>\n<\/ol><h4 id=\"h_1f5b2018e0\">Option 2 <\/h4><p class=\"no-margin\">If you<b> don&rsquo;t want to keep the subdomain active<\/b>, you can leave the previous database connected.<\/p><p class=\"no-margin\">\n<\/p><h2 id=\"h_3bb9facaa1\">Step 3 &ndash; Fix URLs<\/h2><p class=\"no-margin\">Finally, update your website&rsquo;s URLs by<b> replacing the subdomain with the root domain<\/b>. There are a couple of ways to do that:<\/p><ul>\n<li>\n<p class=\"no-margin\">Define the URL by editing the <b>wp-config.php<\/b> file as described here: <b><a href=\"https:\/\/wordpress.org\/documentation\/article\/changing-the-site-url\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Changing the Site URL<\/a><\/b><\/p>\n<\/li>\n<li>\n<p class=\"no-margin\">Use a plugin, e.g., <b><a href=\"https:\/\/wordpress.org\/plugins\/better-search-replace\/\" target=\"_blank\" class=\"intercom-content-link\" rel=\"noopener\">Better Search Replace<\/a><\/b> <\/p>\n<\/li>\n<\/ul><p class=\"no-margin\">And that&rsquo;s how you move your website from a subdomain to the root domain &#128522; <\/p>\n","protected":false},"excerpt":{"rendered":"<p>Learn how to manually migrate your WordPress website from a subdomain to the root domain<\/p>\n","protected":false},"author":581,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"include_on_kodee":true,"footnotes":""},"categories":[275],"tags":[],"class_list":["post-646","post","type-post","status-publish","format-standard","hentry","category-other-website"],"hreflangs":[{"locale":"en-US","link":"https:\/\/www.hostinger.com\/support\/8165530-how-to-move-a-wordpress-website-from-a-subdomain-to-the-root-domain-in-hostinger\/","default":1}],"include_on_kodee":true,"_links":{"self":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/646","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/users\/581"}],"replies":[{"embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/comments?post=646"}],"version-history":[{"count":1,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"predecessor-version":[{"id":2856,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/646\/revisions\/2856"}],"wp:attachment":[{"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/media?parent=646"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/categories?post=646"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/tags?post=646"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}