Redirects and Subdirectory migration to Root Directory

I do the following:

  • Move all old files in the root dir to a special folder (i.e. “_old”)
  • Login to the new site in subdir and remove the subdir from the WordPress and Site Adress (so remove sitename.org/new and enter sitename.org)
  • Using FTP or your hosts file manager, move all files from the subdir “new” to the root
  • Now you can login to the new site in the root dir
  • Flush / Resave permalinks
  • Search and Replace the subdir URL with the root URL inside the wp-database (using one of many plugins, i.e “Better Search and Replace”, dont update the GUIDs)
  • Add rewrite rules per htaccess or per wp plugin (i.e. “All 404 Redirect to Homepage”)
  • Reset caching and test the site to see if everything is ok

But before anything, create backups!