To move a WordPress site to a subdirectory on the same domain, follow these essential steps:

  1. Create the Subdirectory: On your server, create the desired subfolder (e.g., /blog) inside your existing web root.
  2. Move WordPress Files: Copy all WordPress files and folders from the current directory (typically the root) into the new subdirectory.
  3. Update Site URLs:
    • Log in to your WordPress admin dashboard (Settings > General).
    • Update both the WordPress Address (URL) and Site Address (URL) to include the new subdirectory path (e.g., https://yourdomain.com/blog).
    • Alternatively, update the siteurl and home options directly in the database in the [prefix]_options table.
  4. Fix Permalinks:
    • Log into WP Admin, go to Settings > Permalinks, and click “Save Changes” to regenerate .htaccess rules for the new location.
    • Check for 404 errors and verify all internal links and media paths.
  5. Test and Clean Up:
    • Browse your site in the new subdirectory to ensure everything works.
    • Remove or archive the old directory from the root if it isn’t needed.

Considerations:

  • If internal links or images still point to the old path, you may need to update them (plugins like “Better Search Replace” can help).
  • Always create a full backup of your files and database before starting this process.
  • No changes to filesystem absolute paths are usually needed, as WordPress uses relative paths for content.

This process applies to moving a live site; steps may differ if you wish for the main domain to keep loading WordPress while the files reside in a subfolder (in that case, see WordPress documentation on [“Giving WordPress Its Own Directory”]).

If you want the site to run at the subdirectory URL, this method is correct. If you want to move from a subdomain, the procedure is very similar, but adjust your target paths accordingly.

Caveats:

  • Some plugins or hard-coded links may require additional changes.
  • Caching or CDN setups might require cache purge post-move.
  • Always verify database updates, as incorrect URLs can lock you out of your admin area.

If a visual step-by-step is required, several guides and videos are available, but the steps above summarize the necessary process for manual migration within the same domai