Skip to content
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Drop no-op updateSiteUrl call from WxrImporter
updateSiteUrl only rewrites the target site's own URL and returns early when it
is unchanged — which is always the case for a WXR merge (the DB keeps the
target URL, and the importer has no knowledge of the source URL). The call did
nothing but implied a capability it lacks. Replace it with a comment explaining
why internal links keep pointing at the source, matching the dashboard importer.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
  • Loading branch information
wojtekn and claude committed Jul 2, 2026
commit f1dbbf0fe2a65fd98c69caa8030a200d95fdcc2c
7 changes: 5 additions & 2 deletions apps/cli/lib/import-export/import/importers/wxr-importer.ts
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@ import {
import { runWpCliCommand } from 'cli/lib/run-wp-cli-command';
import { ImportExportEventEmitter } from '../../events';
import { BackupContents } from '../types';
import { updateSiteUrl } from '../update-site-url';
import { ensureDir, Importer, ImporterResult } from './importer';

// Files staged into the site for the import are placed under this directory (at the
Expand Down Expand Up @@ -88,7 +87,11 @@ export class WxrImporter extends ImportExportEventEmitter implements Importer {

this.emit( ImportEvents.IMPORT_DATABASE_COMPLETE );

await updateSiteUrl( site );
// Note: no site-URL rewrite here. Unlike the SQL/backup importers (which
// replace the whole database with the source site's URL), a WXR merge leaves
// the target site's URL unchanged, and the importer has no knowledge of the
// source site's URL. Internal links inside imported posts therefore keep
// pointing at the source — matching the WordPress dashboard importer.

this.emit( ImportEvents.IMPORT_COMPLETE, 'xml' );
return {
Expand Down
Loading