{"id":2110,"date":"2024-10-23T12:21:17","date_gmt":"2024-10-23T12:21:17","guid":{"rendered":"https:\/\/tiruppurwebhosting.com\/blog\/?p=2110"},"modified":"2024-10-23T12:22:41","modified_gmt":"2024-10-23T12:22:41","slug":"move-wordpress-from-subfolder-to-root","status":"publish","type":"post","link":"https:\/\/tiruppurwebhosting.com\/blog\/move-wordpress-from-subfolder-to-root\/","title":{"rendered":"From Subfolder to Homepage: Moving Your WordPress Site with Ease"},"content":{"rendered":"<h1>Move WordPress from Subfolder to Root &#8211; If you\u2019ve set up your WordPress site in a subfolder and now want to move it to the root directory, you\u2019re not alone. This common scenario can help streamline your website\u2019s URL structure and improve user experience.<\/h1>\n<figure style=\"width: 550px\" class=\"wp-caption alignnone\"><img loading=\"lazy\" decoding=\"async\" src=\"https:\/\/www.wpbeginner.com\/wp-content\/uploads\/2017\/09\/subdomaintoroot.png\" alt=\"Move WordPress from Subfolder to Root\" width=\"550\" height=\"340\" \/><figcaption class=\"wp-caption-text\">Move WordPress from Subfolder to Root<\/figcaption><\/figure>\n<h2>Move WordPress from Subfolder to Root &#8211; In this guide, we\u2019ll walk you through the steps to seamlessly move your <a href=\"https:\/\/tiruppurwebhosting.com\/shared-web-hosting.html\">WordPress site<\/a> from a subfolder to your homepage without losing data or functionality.<\/h2>\n<h2>Why Move WordPress to the Root Directory?<\/h2>\n<p>Moving your WordPress site to the root directory offers several benefits:<\/p>\n<ul>\n<li><strong>Simplified URL Structure<\/strong>: A cleaner URL (e.g., <code>yourwebsite.com<\/code> instead of <code>yourwebsite.com\/subfolder<\/code>) improves SEO and user experience.<\/li>\n<li><strong>Ease of Access<\/strong>: Users can find your site more easily when it\u2019s accessible from the primary domain.<\/li>\n<li><strong>Improved Site Management<\/strong>: Managing your site in the root directory can be simpler, especially for updates and backups.<\/li>\n<\/ul>\n<h2>Step-by-Step Guide to Move WordPress from Subfolder to Root<\/h2>\n<h3>Step 1: Backup Your Site<\/h3>\n<p>Before making any changes, it\u2019s crucial to back up your entire WordPress site. This includes your database and all files. You can use a plugin like <strong>UpdraftPlus<\/strong> or <strong>BackWPup<\/strong>, or perform a manual backup via <a href=\"https:\/\/www.squarebrothers.com\/cpanel-hosting-india\/\" target=\"_blank\" rel=\"noopener\">cPanel<\/a> or FTP.<\/p>\n<h3>Step 2: Move Files from Subfolder to Root Directory<\/h3>\n<ol>\n<li><strong>Access Your Server<\/strong>: Use an FTP client (like FileZilla) or your <a href=\"https:\/\/www.squarebrothers.com\/wordpress-hosting-india\/\" target=\"_blank\" rel=\"noopener\">web hosting<\/a> control panel (like cPanel) to access your website files.<\/li>\n<li><strong>Navigate to Subfolder<\/strong>: Go to the directory where your WordPress files are currently located (e.g., <code>public_html\/subfolder<\/code>).<\/li>\n<li><strong>Select All Files<\/strong>: Highlight all files and folders within the subfolder, excluding the subfolder itself.<\/li>\n<li><strong>Move Files<\/strong>: Drag and drop the selected files to the root directory (e.g., <code>public_html<\/code>).<\/li>\n<\/ol>\n<h3>Step 3: Update the Site URL in WordPress<\/h3>\n<ol>\n<li><strong>Log into WordPress Admin<\/strong>: Go to your WordPress admin dashboard (if accessible).<\/li>\n<li><strong>Go to Settings<\/strong>: Navigate to <strong>Settings &gt; General<\/strong>.<\/li>\n<li><strong>Update URLs<\/strong>: Change both the <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong> to reflect your new root directory (e.g., <code>https:\/\/yourwebsite.com<\/code>).<\/li>\n<li><strong>Save Changes<\/strong>: Click <strong>Save Changes<\/strong> at the bottom of the page.<\/li>\n<\/ol>\n<h3>Step 4: Update the <code>.htaccess<\/code> File<\/h3>\n<p>If you have a custom <code>.htaccess<\/code> file, you may need to update it to ensure proper redirection.<\/p>\n<ol>\n<li><strong>Access the Root Directory<\/strong>: Using your FTP client or file manager, locate the <code>.htaccess<\/code> file in the root directory.<\/li>\n<li><strong>Edit the File<\/strong>: Open it and make sure the WordPress rewrite rules are correct. The standard rules look like this:\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary\">plaintext<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center py-1\">Copy code<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-plaintext\"># BEGIN WordPress<br \/>\n&lt;IfModule mod_rewrite.c&gt;<br \/>\nRewriteEngine On<br \/>\nRewriteBase \/<br \/>\nRewriteRule ^index\\.php$ - [L]<br \/>\nRewriteCond %{REQUEST_FILENAME} !-f<br \/>\nRewriteCond %{REQUEST_FILENAME} !-d<br \/>\nRewriteRule . \/index.php [L]<br \/>\n&lt;\/IfModule&gt;<br \/>\n# END WordPress<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li><strong>Save and Close<\/strong>: After making any necessary adjustments, save the file.<\/li>\n<\/ol>\n<h3>Step 5: Test Your Site<\/h3>\n<ol>\n<li><strong>Clear Cache<\/strong>: Clear your browser cache and any caching plugins on your site.<\/li>\n<li><strong>Visit Your Site<\/strong>: Enter your domain name in the browser and check if everything loads correctly from the root directory.<\/li>\n<li><strong>Check Links<\/strong>: Test various links and functionality to ensure everything is working smoothly.<\/li>\n<\/ol>\n<h3>Step 6: Set Up 301 Redirects (If Necessary)<\/h3>\n<p>If users may still access the old URL (subfolder), set up 301 redirects to direct them to the new location.<\/p>\n<ol>\n<li><strong>Edit the <code>.htaccess<\/code> File<\/strong>: In the root directory, add a line to redirect the old subfolder URL to the new root URL:\n<div class=\"contain-inline-size rounded-md border-[0.5px] border-token-border-medium relative bg-token-sidebar-surface-primary dark:bg-gray-950\">\n<div class=\"flex items-center text-token-text-secondary px-4 py-2 text-xs font-sans justify-between rounded-t-md h-9 bg-token-sidebar-surface-primary dark:bg-token-main-surface-secondary\">plaintext<\/div>\n<div class=\"sticky top-9 md:top-[5.75rem]\">\n<div class=\"absolute bottom-0 right-2 flex h-9 items-center\">\n<div class=\"flex items-center rounded bg-token-sidebar-surface-primary px-2 font-sans text-xs text-token-text-secondary dark:bg-token-main-surface-secondary\"><span class=\"\" data-state=\"closed\"><button class=\"flex gap-1 items-center py-1\">Copy code<\/button><\/span><\/div>\n<\/div>\n<\/div>\n<div class=\"overflow-y-auto p-4\" dir=\"ltr\"><code class=\"!whitespace-pre hljs language-plaintext\">Redirect 301 \/subfolder\/ https:\/\/yourwebsite.com\/<br \/>\n<\/code><\/div>\n<\/div>\n<\/li>\n<li><strong>Save Changes<\/strong>: Ensure you save the <code>.htaccess<\/code> file after adding the redirect.<\/li>\n<\/ol>\n<h2>Conclusion<\/h2>\n<p>Move WordPress from Subfolder to Root <span style=\"font-size: 16px;\">directory can significantly enhance accessibility and improve your site&#8217;s overall SEO. By following these steps, you can make the transition smoothly and with minimal disruption. Always remember to back up your site before making any changes and test thoroughly after the move. With your WordPress site now in the root directory, you&#8217;re ready to enjoy a cleaner, more user-friendly web presence!<\/span><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Move WordPress from Subfolder to Root &#8211; If you\u2019ve set up your WordPress site in a subfolder and now want to move it to the root directory, you\u2019re not alone. This common scenario can help streamline your website\u2019s URL structure and improve user experience. Move WordPress from Subfolder to Root &#8211; In this guide, we\u2019ll<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[5],"tags":[],"class_list":["post-2110","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/2110","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/comments?post=2110"}],"version-history":[{"count":3,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/2110\/revisions"}],"predecessor-version":[{"id":2113,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/posts\/2110\/revisions\/2113"}],"wp:attachment":[{"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/media?parent=2110"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/categories?post=2110"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tiruppurwebhosting.com\/blog\/wp-json\/wp\/v2\/tags?post=2110"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}