{"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-09-15T10:20:39","modified_gmt":"2026-09-15T10:20:39","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":"
If you wish to move your website from a subdomain to the root domain<\/b> ( First, make sure the root domain<\/b> is added to your hosting plan<\/a><\/b> – it should be visible in the Websites<\/a> <\/b>section of Hostinger dashboard.<\/p>\n<\/div> To choose the correct destination folder (e.g., There are two options to choose from:<\/p> If you wish for the subdomain to remain active<\/b>, duplicate the database and connect the new database to your website:<\/p> Download a backup<\/a><\/b> of your original website’s database<\/b><\/p>\n<\/li>\n Create a new database<\/a><\/b> for your new website (that’s on the root domain)<\/p>\n<\/li>\n Import the database backup to the new website<\/p>\n<\/li>\n Update the database details<\/a><\/b> (name, username, password) in the wp-config.php<\/b> file<\/p>\n<\/li>\n<\/ol> If you don’t want to keep the subdomain active<\/b>, you can leave the previous database connected.<\/p> Finally, update your website’s URLs by replacing the subdomain with the root domain<\/b>. There are a couple of ways to do that:<\/p> Define the URL by editing the wp-config.php<\/b> file as described here: Changing the Site URL<\/a><\/b><\/p>\n<\/li>\n Use a plugin, e.g., Better Search Replace<\/a><\/b><\/p>\n<\/li>\n<\/ul> And that’s how you move your website from a subdomain to the root domain.<\/p> Additional resources<\/strong><\/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":5,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/646\/revisions"}],"predecessor-version":[{"id":17091,"href":"https:\/\/www.hostinger.com\/support\/wp-json\/wp\/v2\/posts\/646\/revisions\/17091"}],"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}]}}subdomain.domain.tld<\/code> → domain.tld<\/code>), follow the steps below.<\/p>Step 1 – Copy files from the subdomain to the root domain<\/h2>
\n
subdomain.domain.tld<\/code>), <\/b>and then open the public_html<\/b> folder within:
\n
<\/li>\n
\n
<\/li>\n<\/ol>domain.tld<\/code>), click on the .. icon<\/b> to go to the parent folder as many times as you need. Learn more: Basic Actions in the File Manager<\/a><\/b><\/p>Step 2 – Connect the database<\/h2>
Option 1<\/h4>
\n
Option 2<\/h4>
Step 3 – Fix URLs<\/h2>
\n
\n