Type something to search...
How to Import and Export Content Between WordPress Sites?

How to Import and Export Content Between WordPress Sites?

You are merging a company's old blog into its new website, or splitting a product section into a separate site, or building a fresh design on a new install and need the real content in it. You do not want to move the whole site, with its plugins, settings, and years of leftovers. You want the content. WordPress has a built-in way to do exactly that, but it has quiet gaps: widgets do not travel, media depends on the old site staying online, and URLs inside your content still point to the old domain after the import.

This article covers moving content between WordPress sites properly: what the built-in exporter includes and leaves out, how to export and import in the dashboard, how to do the same with WP-CLI for large sites, how to handle media, authors, menus, block theme templates, synced patterns, and WooCommerce products, how to fix URLs afterward, and how to avoid duplicate content when you import twice.

Content Transfer vs Full Site Migration

Before you start, decide which job you are doing:

GoalRight tool
Move a whole site to a new host or domain, unchangedFull migration: files plus database
Copy some or all content into a different WordPress installExport and import (this article)
Merge content from several sites into oneExport and import, one source at a time
Copy products into a different WooCommerce storeWooCommerce product CSV export and import

A full migration copies everything, including plugin settings, users with passwords, and theme options. If that is what you need, follow how to migrate a WordPress website to a new hosting provider instead. The export and import route is for content, and it deliberately leaves configuration behind.

What the WordPress Exporter Includes

The built-in exporter creates a WXR file (WordPress eXtended RSS), an XML file that describes content and its relationships.

Included in WXRNot included in WXR
Posts, pages, and custom post types that allow exportPlugin and theme files
Comments and comment metadataPlugin settings and most site options
Categories, tags, and custom taxonomy termsWidgets
Custom fields (post meta)Customizer settings and classic theme options
Navigation menus (with "All content")User passwords and users who have no content
Media attachments as records with their original URLsThe media files themselves
Authors of the exported contentWooCommerce orders and store settings

The most important line in that table: media files are not inside the XML file. The file only lists each attachment's URL. During import, WordPress downloads each file from the old site. If the old site is offline, password protected, or blocking requests, the images are not imported.

Exporting Content from the Dashboard

On the source site:

  1. Go to Tools → Export.
  2. Choose what to export:
    • All content includes posts, pages, comments, custom fields, terms, navigation menus, and custom posts.
    • Posts lets you filter by category, author, date range, and status.
    • Pages lets you filter by author, date range, and status.
    • Media lets you filter by date range.
    • Custom post types registered with export support appear as additional options.
  3. Click Download Export File.

You get a file named something like sitename.WordPress.2026-10-09.xml.

Choose All content unless you have a reason not to. Partial exports break relationships. For example, exporting only Posts does not include the media attachment records for featured images, so the imported posts lose their featured images. Exporting only Pages leaves out menus.

Importing Content in the Dashboard

On the destination site:

  1. Go to Tools → Import.
  2. Under WordPress, click Install Now. This installs the official WordPress Importer plugin.
  3. Click Run Importer.
  4. Choose your WXR file and click Upload file and import.
  5. On the Assign Authors screen, map each author from the old site to an existing user on the new site, or create a new user with the login name shown.
  6. Tick Download and import file attachments so media is copied from the old site.
  7. Click Submit and wait. Large imports can take several minutes.

When it finishes, you see "All done. Have fun!" along with any items that failed, such as attachments that could not be downloaded.

Upload Size Limits

If the upload fails immediately, the file is larger than PHP's upload_max_filesize or post_max_size. You can raise those limits with your host, split the export into smaller pieces by date range, or skip the browser entirely and use WP-CLI, which has no upload limit.

Exporting and Importing with WP-CLI

For sites with thousands of posts, WP-CLI is faster, more reliable, and scriptable. If you are new to it, how to use WP-CLI to manage WordPress from the command line covers installation and the basics.

Export

# Terminal, on the source server, inside the WordPress directory
wp export --dir=/tmp/exports

Useful options:

# Terminal
# Only published posts in one category, split into 15 MB files
wp export --dir=/tmp/exports --post_type=post --post_status=publish \
  --category=news --max_file_size=15

# A specific date range
wp export --dir=/tmp/exports --start_date=2024-01-01 --end_date=2024-12-31

# Specific post IDs
wp export --dir=/tmp/exports --post__in="12 45 78"

--max_file_size splits large exports into several files, each of which can be imported separately.

Import

wp import uses the same WordPress Importer plugin, so install it first on the destination site:

# Terminal, on the destination server, inside the WordPress directory
wp plugin install wordpress-importer --activate
wp import /tmp/exports/sitename.wordpress.2026-10-09.000.xml --authors=create

The --authors option controls author mapping:

  • --authors=create creates any authors that do not exist.
  • --authors=skip assigns everything to the current user, which you set with --user.
  • --authors=mapping.csv reads a CSV file that maps old usernames to new ones. If the file does not exist, WP-CLI generates it for you to fill in.
# Terminal
# Assign all imported content to the admin user and skip media download
wp import export.xml --authors=skip --user=admin --skip=attachment

Use --skip=attachment only when you are moving the media files yourself, as described in the next section.

Handling Media Reliably

Media causes most import problems. There are two approaches.

Option 1: Let the Importer Download Media (Default)

Keep the source site online and publicly reachable during the import, and tick Download and import file attachments. This creates proper attachment records and generates thumbnails on the new site. Its weaknesses are speed and timeouts: each file is downloaded over HTTP, so thousands of images can take a long time, and a slow server can time out partway. If an import stops midway, run it again; the importer skips posts it already created (see the duplicates section below) and retries what is missing.

Common reasons media fails to download:

  • The old site is behind a login, maintenance mode, or basic authentication.
  • A security plugin or firewall on the old site blocks the new server's requests.
  • The old site is on localhost and the new site cannot reach it.
  • Media URLs use a CDN domain that no longer exists.

Option 2: Copy Files, Then Fix URLs

For very large libraries, or when the old site is offline, copy the wp-content/uploads folder from the old server to the new one with SFTP or rsync, import the content without attachments, and then update the URLs in content to point at the new domain.

# Terminal, from the new server
rsync -avz user@old-server:/var/www/old-site/wp-content/uploads/ \
  /var/www/new-site/wp-content/uploads/

The trade-off: images embedded in post content display correctly once URLs are fixed, but without attachment records, they do not appear in the Media Library and featured images are not set. If you need a complete Media Library, use Option 1.

Fixing URLs After Import

Imported posts still contain links and image URLs pointing at the old domain. Replace them with WP-CLI's search-replace, which also handles serialized data safely:

# Terminal, on the destination site
# Preview first
wp search-replace 'https://old-site.com' 'https://new-site.com' --skip-columns=guid --dry-run

# Then run it for real
wp search-replace 'https://old-site.com' 'https://new-site.com' --skip-columns=guid
  • Always run with --dry-run first and read the count of replacements per table.
  • --skip-columns=guid leaves the GUID column alone. GUIDs identify posts in feeds and should not change.
  • Take a backup before running it. If you need a backup routine, see how to create a backup for a WordPress website.

If you do not have WP-CLI, plugins such as Better Search Replace do the same job from the dashboard.

Moving Things the Exporter Leaves Behind

Navigation Menus

Classic menus are included in All content exports. They import as menus, but menu locations are theme settings, so assign them again under Appearance → Menus → Manage Locations. Menu items that link to pages or posts work only if those items were imported too.

On block themes, the Navigation block stores menus as wp_navigation posts. Check the result in the Site Editor after import, and rebuild any navigation that comes through empty.

Block Theme Templates and Global Styles

Templates and template parts you edited in the Site Editor, along with global styles, are tied to the theme. The reliable way to move them is to export the theme with your customizations:

  1. On the source site, go to Appearance → Editor.
  2. Open the Options menu (the three dots) and choose Export. WordPress downloads a ZIP of the active theme that includes your template changes and global styles in theme.json.
  3. On the destination site, upload and activate that theme under Appearance → Themes → Add New Theme → Upload Theme.

The Create Block Theme plugin offers more control over this, such as saving changes into the theme or creating a child theme.

Synced Patterns

Synced patterns (formerly reusable blocks) can be moved individually as JSON:

  1. On the source site, open Appearance → Editor → Patterns.
  2. Open a pattern's actions menu and choose Export as JSON.
  3. On the destination site, open the Patterns screen, use the add or import option, and choose Import from JSON.

Posts that reference a synced pattern store its ID, so import the patterns before you rely on them in imported content, and check that the references still resolve. More on how they work in how to use synced patterns in WordPress.

Widgets and Customizer Settings

Neither is part of WXR. On classic themes, use a dedicated plugin such as Widget Importer and Exporter for widgets and Customizer Export/Import for Customizer settings. On block themes, widgets are replaced by template parts, which travel with the exported theme.

Users

The WXR file only includes users who authored exported content, and never their passwords. Imported or created authors need to reset their passwords. If you need to move every user with roles and password hashes intact, that requires a database-level migration or a dedicated user migration plugin.

Moving WooCommerce Products

WooCommerce products are a custom post type, so they appear in the WordPress exporter. But product data such as variations, attributes, stock, and prices is spread across post meta and lookup tables, and the CSV tools handle it much more reliably.

Export products:

  1. Go to Products → All Products.
  2. Click Export at the top of the screen.
  3. Choose columns, product types, and categories, or leave the defaults to export everything.
  4. Tick Export custom meta if you need meta data added by extensions.
  5. Click Generate CSV.

Import products:

  1. On the destination store, go to Products → All Products and click Import.
  2. Upload the CSV file. Tick Update existing products only if you are updating products that already exist with matching IDs or SKUs.
  3. Map the CSV columns to product fields. Columns generated by the WooCommerce exporter map automatically.
  4. Click Run the importer.

Product images are downloaded from the URLs in the CSV, so the source store must be reachable, just like WXR media. Global attributes are created as needed, but check them under Products → Attributes afterward. If you are setting up variable products on the new store, how to set up product variations in WooCommerce explains how attributes and variations fit together.

Orders, customers, coupons, and store settings are not part of the product CSV. Moving those requires a full migration or a dedicated store migration tool.

Avoiding Duplicates When You Import Again

The WordPress Importer checks whether a post with the same title, post type, and date already exists, and skips it if so. That makes it safe to rerun an interrupted import. It also means:

  • Importing the same file twice does not duplicate posts, but it does not update them either. Changes made on the source after the first import are not applied.
  • Terms are matched by slug. A category with the same slug on the destination is reused rather than duplicated.
  • Attachments are checked the same way as posts. Files that were already imported are skipped rather than downloaded again.

If you need to sync changes repeatedly between two live sites, export and import is the wrong tool. Consider a staging workflow, covered in how to set up a WordPress staging site, or a content syndication plugin.

A Checklist for a Clean Transfer

  1. Back up the destination site.
  2. Install the same plugins on the destination that register custom post types, taxonomies, or fields used by the content, before importing. Content for an unregistered post type is skipped.
  3. Export All content from the source.
  4. Import on the destination with attachments enabled, or with attachments skipped if you are copying the uploads folder.
  5. Map authors deliberately.
  6. Run wp search-replace from the old URL to the new URL.
  7. Reassign menu locations, and import the theme export and synced patterns for block themes.
  8. Regenerate permalinks by visiting Settings → Permalinks and clicking Save Changes.
  9. Spot-check posts with galleries, featured images, embeds, and custom fields.

Common Problems and Fixes

  • "Sorry, there has been an error. This does not appear to be a WXR file." The file is incomplete or not an export file. Download the export again and make sure you are not uploading a ZIP or an HTML error page.
  • The import stops partway or shows a blank screen. PHP hit a time or memory limit. Rerun the import, which skips completed items, or use wp import, which runs without a web server timeout.
  • "Failed to import Media." The importer could not download the file. Confirm the old URL opens in a browser, disable protection on the source temporarily, or copy the uploads folder manually.
  • Featured images are missing. The export did not include attachments, or attachments were skipped. Export All content and import again with attachments enabled.
  • Custom post type content is missing. The post type was not registered on the destination during import. Activate the plugin that registers it and import again.
  • Imported posts are assigned to the wrong author. Author mapping happens only during import. Use Posts → All Posts, filter by author, and bulk-edit the author, or delete and reimport with the right mapping.
  • Links still point to the old site. Run wp search-replace as shown above.

WordPress Import and Export FAQ

No. The export file only contains references to media URLs. The importer downloads each file from the old site during import, so the source site must be online and publicly reachable, or you must copy the uploads folder yourself.

No. Widgets, Customizer settings, and plugin settings are not part of the export file. Use dedicated plugins for classic theme widgets and Customizer settings, and export the theme from the Site Editor to move block theme templates and global styles.

Generally no. The WordPress Importer skips posts that already exist with the same title, post type, and date, which makes it safe to rerun an interrupted import. It also means changed content is not updated on a second import.

Split the export into smaller files by date range or with the WP-CLI max file size option, or import with the WP-CLI import command, which avoids browser upload limits and web server timeouts.

No. Use the WooCommerce product CSV exporter and importer for products. Orders, customers, and store settings require a full site migration or a dedicated store migration tool.

No. The export only includes authors of the exported content, without passwords. Imported users must reset their passwords, or you need a database-level migration to move users with their password hashes.

Conclusion

Moving content between WordPress sites is straightforward once you know what the export file actually carries. WXR moves posts, pages, custom post types, comments, terms, custom fields, menus, and attachment records, but not media files, widgets, settings, or user passwords. The importer fetches media from the old site, so keep it online, or copy the uploads folder and accept the trade-offs.

For reliable results, export All content, register the same post types on the destination first, use WP-CLI for anything large, fix URLs with search-replace, and move block theme templates, synced patterns, and WooCommerce products with their own tools. With that checklist, you can merge, split, or rebuild sites without losing a post or a featured image.

Here are some useful references for going deeper on importing and exporting WordPress content:

  1. WordPress Documentation: Tools Export Screen — what each export option includes.
  2. WordPress Documentation: Importing Content — the built-in importers and the WordPress Importer workflow.
  3. WP-CLI Handbook: wp export and wp import — every option for command-line transfers.
  4. WP-CLI Handbook: wp search-replace — safe URL replacement including serialized data.
  5. WooCommerce Docs: Product CSV Importer and Exporter — moving products, variations, and attributes between stores.
Tags :
Share :

Related Posts

WordPress optimization with specific recommended approach

WordPress optimization with specific recommended approach

Whether you run a high traffic WordPress installation or a small blog on a low cost shared host, you should optimize WordPress and your server to run

Continue Reading
Creating and Customizing WordPress Child Themes

Creating and Customizing WordPress Child Themes

Creating a child theme in WordPress is a best practice for making modifications to a theme. By using a child theme, you can update the parent theme w

Continue Reading
Understanding the Distinction Categories vs. Tags in WordPress

Understanding the Distinction Categories vs. Tags in WordPress

WordPress, a powerful content management system, offers a plethora of features to organize content effectively. Among these features, categories and

Continue Reading