{"id":1433,"date":"2026-10-19T10:03:54","date_gmt":"2026-10-19T10:03:54","guid":{"rendered":"https:\/\/cloudabove.com\/help\/?p=1433"},"modified":"2026-10-19T10:03:55","modified_gmt":"2026-10-19T10:03:55","slug":"how-to-move-a-wordpress-site-from-a-subdirectory-to-the-domain-root","status":"publish","type":"post","link":"https:\/\/cloudabove.com\/help\/how-to-move-a-wordpress-site-from-a-subdirectory-to-the-domain-root\/","title":{"rendered":"How to Move a WordPress Site from a Subdirectory to the Domain Root"},"content":{"rendered":"\n<p>During site development or migration, WordPress is frequently installed into a subdirectory (such as <code>\/wp\/<\/code>, <code>\/v2\/<\/code>, or <code>\/wordpress\/<\/code>). This makes your website accessible only via <code>yourdomain.co.uk\/wp\/<\/code> instead of <code>yourdomain.co.uk<\/code>.<\/p>\n\n\n\n<p>Moving WordPress to your domain root (<code>public_html<\/code> or <code>httpdocs<\/code>) makes your site load directly on your primary domain. While changing the web address seems simple, <strong>this process requires moving server files and updating configuration settings<\/strong>, meaning it cannot be done through the WordPress admin panel alone.<\/p>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"prerequisites-preparation\">Prerequisites &amp; Preparation<\/h3>\n\n\n\n<p>Before making any changes to site files or database URLs:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Take a Complete Backup:<\/strong> Perform a full backup of both your website files and database.<\/li>\n\n\n\n<li><strong>Note Current Settings:<\/strong> Log into your WordPress dashboard and navigate to <strong>Settings &gt; General<\/strong> to take note of your current <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong>.<\/li>\n\n\n\n<li><strong>Check Your Document Root:<\/strong> Identify where your main site lives (<code>public_html<\/code> on cPanel or <code>httpdocs<\/code> on Plesk).<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-1-update-wordpress-url-settings\">Step 1: Update WordPress URL Settings<\/h3>\n\n\n\n<p>Before moving any files on the server, you must inform WordPress of its new location. You can do this via the WordPress Admin dashboard or directly in the database.<\/p>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"option-a-via-wordpress-admin-panel-recommended\">Option A: Via WordPress Admin Panel (Recommended)<\/h4>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Log into your WordPress dashboard (e.g., <code>yourdomain.co.uk\/wp\/wp-admin<\/code>).<\/li>\n\n\n\n<li>Go to <strong>Settings &gt; General<\/strong>.<\/li>\n\n\n\n<li>Change both the <strong>WordPress Address (URL)<\/strong> and <strong>Site Address (URL)<\/strong> from <code>(http:\/\/yourdomain.co.uk\/wp)<\/code> to <code>(http:\/\/yourdomain.co.uk)<\/code>.<\/li>\n\n\n\n<li>Click <strong>Save Changes<\/strong>. <em>(Note: Your site will temporarily show errors or break until you complete the file movement steps below).<\/em><\/li>\n<\/ol>\n\n\n\n<h4 class=\"wp-block-heading\" id=\"option-b-via-phpmyadmin-if-admin-access-is-lost\">Option B: Via phpMyAdmin (If Admin Access is Lost)<\/h4>\n\n\n\n<p>If you cannot log into the WordPress admin panel:<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Log into <strong>cPanel\/Plesk<\/strong> and open <strong>phpMyAdmin<\/strong>.<\/li>\n\n\n\n<li>Select your WordPress database from the left menu.<\/li>\n\n\n\n<li>Open the <code>wp_options<\/code> table.<\/li>\n\n\n\n<li>Locate the <code>siteurl<\/code> and <code>home<\/code> rows.<\/li>\n\n\n\n<li>Edit both values, replacing <code>(http:\/\/yourdomain.co.uk\/wp)<\/code> with <code>(http:\/\/yourdomain.co.uk)<\/code>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-2-move-files-to-the-document-root\">Step 2: Move Files to the Document Root<\/h3>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>Open <strong>File Manager<\/strong> in your hosting control panel (or connect via FTP\/SFTP).<\/li>\n\n\n\n<li>Navigate to your subdirectory (e.g., <code>public_html\/wp\/<\/code>).<\/li>\n\n\n\n<li>Select <strong>all files and folders<\/strong> inside the subdirectory.<\/li>\n\n\n\n<li>Move them up one level into your domain root directory (<code>public_html<\/code> or <code>httpdocs<\/code>).<\/li>\n\n\n\n<li>Verify that core files like <code>index.php<\/code>, <code>wp-config.php<\/code>, and the <code>wp-content<\/code> folder now reside directly inside the main root folder.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-3-update-or-create-the-htaccess-file\">Step 3: Update or Create the <code>.htaccess<\/code> File<\/h3>\n\n\n\n<p>Once the files are moved, the rewrite rules in your <code>.htaccess<\/code> file must be updated so WordPress handles URLs correctly.<\/p>\n\n\n\n<ol start=\"1\" class=\"wp-block-list\">\n<li>In your root directory (<code>public_html<\/code>), edit the <code>.htaccess<\/code> file (enable <em>Show Hidden Files<\/em> in File Manager if needed).<\/li>\n\n\n\n<li>Update the default WordPress rules to remove the subdirectory path:<\/li>\n<\/ol>\n\n\n\n<p>Apache<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code># BEGIN WordPress\n&lt;IfModule mod_rewrite.c&gt;\nRewriteEngine On\nRewriteRule .* - &#091;E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]\nRewriteBase \/\nRewriteRule ^index\\.php$ - &#091;L]\nRewriteCond %{REQUEST_FILENAME} !-f\nRewriteCond %{REQUEST_FILENAME} !-d\nRewriteRule . \/index.php &#091;L]\n&lt;\/IfModule&gt;\n# END WordPress\n<\/code><\/pre>\n\n\n\n<ol start=\"3\" class=\"wp-block-list\">\n<li>Click <strong>Save Changes<\/strong>.<\/li>\n<\/ol>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"step-4-post-migration-checks-troubleshooting\">Step 4: Post-Migration Checks &amp; Troubleshooting<\/h3>\n\n\n\n<p>Once files and settings are updated, run through these essential checks:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Flush Permalinks:<\/strong> Log into your updated WordPress dashboard at <code>yourdomain.co.uk\/wp-admin<\/code>, go to <strong>Settings &gt; Permalinks<\/strong>, and click <strong>Save Changes<\/strong> without making alterations. This clears old path caches.<\/li>\n\n\n\n<li><strong>Fix Hardcoded Inner Links &amp; Media:<\/strong> Moving files does not automatically update images or internal links previously saved into page content. Use a search-and-replace plugin (such as <em>Better Search Replace<\/em>) to update references from <code>yourdomain.co.uk\/wp\/wp-content\/uploads\/<\/code> to <code>yourdomain.co.uk\/wp-content\/uploads\/<\/code>.<\/li>\n\n\n\n<li><strong>Clear Caches:<\/strong> Flush any caching plugins (LiteSpeed, WP Rocket) and your local browser cache.<\/li>\n<\/ul>\n\n\n\n<h3 class=\"wp-block-heading\" id=\"common-pitfalls-when-to-contact-support\">Common Pitfalls &amp; When to Contact Support<\/h3>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>500 Internal Server Error:<\/strong> Usually caused by leftover subdirectory paths in the <code>.htaccess<\/code> file. Re-check your <code>.htaccess<\/code> rules in Step 3.<\/li>\n\n\n\n<li><strong>404 Errors on Subpages:<\/strong> Re-saving permalink settings (Step 4) resolves most broken internal link issues.<\/li>\n\n\n\n<li><strong>Mixed Content Warnings:<\/strong> Occur if some media uploads are hardcoded to <code>http:\/\/<\/code> or retain old path prefixes.<\/li>\n<\/ul>\n\n\n\n<blockquote class=\"wp-block-quote is-layout-flow wp-block-quote-is-layout-flow\">\n<p><strong>Need Assistance?<\/strong> If you are uncomfortable moving server files, managing database entries in phpMyAdmin, or run into persistent site errors after moving files, please open a support ticket with our team. We can assist or perform the migration safely on your behalf!<\/p>\n<\/blockquote>\n","protected":false},"excerpt":{"rendered":"<p>During site development or migration, WordPress is frequently installed into a subdirectory (such as \/wp\/, \/v2\/, or \/wordpress\/). This makes your website accessible only via yourdomain.co.uk\/wp\/ instead of yourdomain.co.uk. Moving WordPress to your domain root (public_html or httpdocs) makes your site load directly on your primary domain. While changing the&hellip;<\/p>\n","protected":false},"author":9,"featured_media":0,"comment_status":"closed","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[29],"tags":[],"class_list":["post-1433","post","type-post","status-publish","format-standard","hentry","category-wordpress"],"_links":{"self":[{"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/posts\/1433","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/users\/9"}],"replies":[{"embeddable":true,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/comments?post=1433"}],"version-history":[{"count":1,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/posts\/1433\/revisions"}],"predecessor-version":[{"id":1436,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/posts\/1433\/revisions\/1436"}],"wp:attachment":[{"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/media?parent=1433"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/categories?post=1433"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/cloudabove.com\/help\/wp-json\/wp\/v2\/tags?post=1433"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}