{"id":19652,"date":"2025-04-06T12:24:19","date_gmt":"2025-04-06T10:24:19","guid":{"rendered":"https:\/\/tremhost.com\/blog\/?p=19652"},"modified":"2025-04-06T12:24:19","modified_gmt":"2025-04-06T10:24:19","slug":"how-to-move-wordpress-to-a-new-directory-or-folder","status":"publish","type":"post","link":"https:\/\/tremhost.com\/blog\/how-to-move-wordpress-to-a-new-directory-or-folder\/","title":{"rendered":"How to move WordPress to a new directory or folder"},"content":{"rendered":"<div id=\"bsf_rt_marker\"><\/div><p>Moving your WordPress website to a new directory or folder can be an essential task if you\u2019re looking to reorganize your site, change its structure, or even enhance its security. This process involves several critical steps that require careful attention to ensure that the transition does not affect the functionality or accessibility of your website. The following guide provides a detailed walkthrough of how to move your WordPress installation to a new directory, along with solutions to some common issues that might arise during the migration.<\/p>\n<h2>Step-by-Step Guide: Moving WordPress Directory<\/h2>\n<p>To begin moving your WordPress site to a new directory, first ensure you have a complete backup of your website. This protects your data in case anything goes wrong during the migration. Once your backup is secure, you can proceed by logging into your WordPress dashboard. Go to the Settings &gt; General, and update the WordPress Address (URL) and Site Address (URL) fields to the new directory you wish to move your site to. Remember, do not include any trailing slash at the end of the URL.<\/p>\n<p>Next, access your site\u2019s root folder via an FTP client or your web host&#8217;s file manager. Here, you will need to copy (not move) all files from your existing WordPress directory to the new location you specified in your WordPress settings. This includes the core files, wp-includes, wp-admin, wp-content folders, and all the files in the root directory such as wp-config.php. It\u2019s crucial to ensure that all files are copied over correctly to avoid any issues.<\/p>\n<p>Finally, update your website\u2019s .htaccess file. This file might need to be adjusted if you are changing the URL structure as part of your move. Open the .htaccess file in a text editor and replace any old directory path with the new one. After making the necessary changes, save the file. Now, go back to your WordPress dashboard and reset your permalinks under Settings &gt; Permalinks by simply clicking &#8216;Save Changes&#8217;. This action will ensure that all post and page links are correctly updated to reflect the new directory.<\/p>\n<h2>Troubleshooting Common Migration Issues<\/h2>\n<p>One common issue faced during WordPress migration is broken links or missing images. This usually happens if the file paths are not updated correctly or files were not copied over properly. To resolve this, double-check the wp-content folder in the new location to ensure all themes, plugins, and uploads are intact. Using tools like \u201cSearch and Replace\u201d can help correct paths in your database if manual updates seem overwhelming.<\/p>\n<p>Another frequent problem is getting a 404 error on all pages except the homepage. This typically occurs due to issues with the .htaccess file or permalink settings not being updated correctly. To fix this, revisit your .htaccess file for any incorrect entries and ensure it is writable. Then, go to your WordPress dashboard, navigate to Settings &gt; Permalinks, and click &#8216;Save Changes&#8217; to flush the rewrite rules.<\/p>\n<p>Lastly, access issues can arise where the WordPress admin area becomes unreachable. This might be due to improper updates in the WordPress Address and Site Address URLs in the settings. To correct this, you can manually define these URLs in your wp-config.php file by adding the following lines:<\/p>\n<pre><code class=\"language-php\">define('WP_HOME','http:\/\/example.com\/newdirectory');\ndefine('WP_SITEURL','http:\/\/example.com\/newdirectory');<\/code><\/pre>\n<p>Replace \u201c<a href=\"http:\/\/example.com\/newdirectory\">http:\/\/example.com\/newdirectory<\/a>\u201d with the actual URL you are moving to. This adjustment forces WordPress to use the new directory paths.<\/p>\n<p>Moving your WordPress site to a new directory is a task that, while meticulous, can significantly benefit the organization and structure of your website. By following the detailed steps laid out in this guide, you can ensure a smooth transition to the new directory. Additionally, being prepared to troubleshoot common issues will help maintain your site&#8217;s stability and accessibility. Always remember to back up your site before making any major changes, and you\u2019ll be well on your way to successfully relocating your WordPress installation.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Guide to Relocating Your WordPress Directory<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"om_disable_all_campaigns":false,"tdm_status":"","tdm_grid_status":"","footnotes":""},"categories":[1],"tags":[],"class_list":{"0":"post-19652","1":"post","2":"type-post","3":"status-publish","4":"format-standard","6":"category-general"},"aioseo_notices":[],"_links":{"self":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19652","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/comments?post=19652"}],"version-history":[{"count":1,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19652\/revisions"}],"predecessor-version":[{"id":19909,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/posts\/19652\/revisions\/19909"}],"wp:attachment":[{"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/media?parent=19652"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/categories?post=19652"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/tremhost.com\/blog\/wp-json\/wp\/v2\/tags?post=19652"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}