WP AI Agent
Features Pricing Blog Contact Download Plugin Manage Subscription Get Free Key →

How to Import and Export WordPress Content: A Complete Guide

· · 8 min read

Knowing how to import and export WordPress content is one of the most essential skills for any WordPress site owner, developer, or content manager. Whether you are migrating to a new host, creating a staging environment, backing up your posts, or merging two websites, mastering the WordPress content transfer process will save you significant time and prevent data loss.

Understanding WordPress Import and Export Options

Before diving into the steps, it helps to understand what WordPress allows you to transfer and which tools are available for the job. WordPress content can broadly be split into two categories: database content (posts, pages, comments, users, menus, settings) and file-based content (themes, plugins, uploads, and media).

What the Built-In WordPress Tools Cover

WordPress ships with a native Import and Export tool found under Tools in the admin dashboard. This tool uses the WordPress eXtended RSS (WXR) format — an XML file that carries posts, pages, custom post types, categories, tags, comments, and basic user data. It does not include plugins, themes, or settings such as widgets and customizer options.

When to Use a Plugin Instead

For a full site migration — including the database, media library, theme files, and plugin data — a dedicated plugin such as All-in-One WP Migration, Duplicator, or WP Migrate DB is the better choice. These plugins package everything into a single archive and handle the search-and-replace of URLs automatically.

How to Export WordPress Content Using the Native Tool

The built-in WordPress exporter is the quickest way to grab a portable copy of your site's written content. Follow these steps to generate your WXR export file.

  1. Log in to your WordPress admin dashboard.
  2. Navigate to Tools > Export in the left-hand menu.
  3. Choose what to export. Select All content to download everything, or filter by post type, author, date range, or category.
  4. Click the Download Export File button.
  5. WordPress generates and downloads an .xml file to your computer. Store this file in a safe location.

Exporting Specific Post Types

If your site has custom post types (such as WooCommerce products or portfolio items), those will appear as separate options on the export screen. Select the specific post type you need rather than exporting all content if you only want a targeted subset of data — this keeps the XML file smaller and easier to manage.

Scheduling Automated Exports

The native tool does not support scheduled exports. For automated backups of your content, consider plugins like UpdraftPlus or WP All Export, both of which allow you to schedule recurring XML or CSV exports and send them directly to cloud storage such as Google Drive or Amazon S3.

How to Import WordPress Content Using the Native Tool

Importing a WXR file into a WordPress installation is straightforward, but there are a few important details to pay attention to — especially around media files and user assignment.

  1. Log in to the WordPress admin dashboard of the destination site.
  2. Go to Tools > Import.
  3. Locate WordPress in the list of importers and click Install Now (if the importer plugin is not already installed), then click Run Importer.
  4. Click Choose File, select the .xml export file you downloaded earlier, and click Upload file and import.
  5. On the next screen, assign the imported authors to existing users on the destination site, or create new user accounts for them.
  6. Check the box labelled Download and import file attachments to have WordPress attempt to fetch media files from the original site's URL.
  7. Click Submit and wait for the import process to finish. A success message will confirm how many items were imported.

Troubleshooting Failed Media Imports

The attachment download option relies on the original site being live and accessible. If the source site is offline or the media URLs have changed, images will not import automatically. In that case, manually copy the wp-content/uploads folder via FTP or your hosting file manager, then use the Regenerate Thumbnails plugin to rebuild image sizes on the new server.

Handling Large XML Files

Some hosts impose a maximum file upload size (commonly 32 MB or 64 MB). If your export file exceeds this limit, you have three options: increase the upload limit in php.ini or .htaccess, split the export into smaller chunks by filtering by date range, or use WP-CLI to perform the import from the command line (covered in the next section).

Using WP-CLI to Import and Export WordPress Content

WP-CLI is the official command-line interface for WordPress. It is faster than the admin UI for large sites, fully scriptable, and avoids browser timeout issues that can interrupt big imports.

Exporting Content via WP-CLI

SSH into your server and run the following command from your WordPress root directory to export all content to a WXR file:

# Export all WordPress content to a file named export.xml
wp export --path=/var/www/html --dir=/home/user/backups --filename_format=export.xml

# Export only posts from a specific author
wp export --post_type=post --author=johndoe --dir=/home/user/backups

# Export posts within a date range
wp export --post_type=post --start_date=2024-01-01 --end_date=2024-06-30 --dir=/home/user/backups

Importing Content via WP-CLI

  1. Upload your .xml export file to the destination server (via SFTP or SCP).
  2. Install the WordPress Importer plugin using WP-CLI if it is not already present:
# Install and activate the WordPress Importer plugin
wp plugin install wordpress-importer --activate --path=/var/www/html

# Run the import, creating new authors automatically
wp import /home/user/backups/export.xml --authors=create --path=/var/www/html

# Run the import, mapping authors to existing users
wp import /home/user/backups/export.xml --authors=mapping.csv --path=/var/www/html

The --authors=create flag automatically creates user accounts for any authors found in the XML file. If you prefer to map authors to existing users, create a CSV mapping file and pass it with --authors=mapping.csv. WP-CLI will display a progress indicator and report any skipped or duplicate items once the import completes.

Full Site Migration with Plugins

When you need to move an entire WordPress installation — including the database, all settings, the theme, and every plugin — a dedicated migration plugin is the most reliable approach.

Using All-in-One WP Migration

  1. Install and activate All-in-One WP Migration on the source site.
  2. Go to All-in-One WP Migration > Export and choose Export to > File.
  3. Download the generated .wpress archive file.
  4. Install All-in-One WP Migration on the destination site.
  5. Go to All-in-One WP Migration > Import, drag and drop the .wpress file, and confirm the overwrite warning.
  6. After the import completes, go to Settings > Permalinks and click Save Changes to flush rewrite rules.
  7. Update your domain in Settings > General if the destination site uses a different URL.

Using Duplicator for Large Sites

Duplicator is an excellent choice for larger sites because it creates a standalone installer PHP file alongside the archive. This means you can deploy the site to a new server even before WordPress is installed on the destination. The free version handles sites up to several hundred megabytes, while Duplicator Pro removes size limitations and adds scheduled backup features.

Search and Replace After Migration

After any full-site migration, hard-coded URLs in the database (such as image paths in post content or serialized widget data) will still point to the old domain. Use the Better Search Replace plugin or the WP-CLI command below to update them safely:

# Replace old domain with new domain throughout the database
# The --dry-run flag previews changes without saving them
wp search-replace 'https://oldsite.com' 'https://newsite.com' --skip-columns=guid --dry-run

# Remove --dry-run to apply the changes
wp search-replace 'https://oldsite.com' 'https://newsite.com' --skip-columns=guid

Best Practices for WordPress Content Import and Export

Following a consistent set of best practices will protect your data and make every migration smoother.

Always Back Up Before Importing

Before running any import on an existing site, create a full backup — including the database and all files. Imports can create duplicate content or overwrite existing posts if not handled carefully. A fresh backup means you can roll back in minutes if something goes wrong.

Test on a Staging Environment First

Never perform a major import directly on a live production site. Set up a staging environment (most managed WordPress hosts offer one-click staging), run the import there, verify the content looks correct, and only then push changes to production.

Check User Roles and Permissions After Import

Imported users from another WordPress installation may arrive with roles that do not match your destination site's configuration. Review the Users screen after every import and confirm that no unintended administrator accounts were created.

Verify Permalink Structure

After any import or migration, visit Settings > Permalinks and click Save Changes without altering anything. This action flushes the WordPress rewrite rules and ensures that all your post URLs resolve correctly on the new server.

Frequently Asked Questions

Does WordPress export include images and media files?

The native WordPress export tool includes references (URLs) to media files in the XML, and the importer will attempt to download those files from the original site. However, if the source site is offline, you must manually transfer the wp-content/uploads folder via FTP or SFTP to ensure all media is available on the destination site.

How do I import and export WordPress content between different domains?

Export your content using the native tool or a plugin, then import it on the new domain. After importing, run a search-and-replace on the database to update all hard-coded URLs from the old domain to the new one. The WP-CLI wp search-replace command or the Better Search Replace plugin are the most reliable ways to do this without corrupting serialized data.

Can I import content from another platform (like Blogger or Tumblr) into WordPress?

Yes. WordPress ships with importers for Blogger, LiveJournal, Movable Type, TypePad, and several other platforms, all accessible from Tools > Import. For platforms not listed there, third-party plugins often fill the gap. You may also export content from the source platform to an RSS feed and use an RSS importer to bring it into WordPress.

What is the maximum file size for a WordPress import?

The maximum upload size is controlled by PHP settings on your server, typically upload_max_filesize and post_max_size in php.ini. Many hosts default to 32 MB or 64 MB. If your export file is larger, increase these values in php.ini, use WP-CLI to import from the command line, or split the export into smaller files by filtering on date range or post type.

Mastering WordPress content import and export empowers you to migrate sites confidently, maintain reliable backups, and merge content from multiple sources without data loss. If you would prefer to handle tasks like these through a simple conversation rather than navigating menus and running commands yourself, WP AI Agent is a powerful tool that lets you manage WordPress tasks — including content migrations, imports, and exports — through natural-language AI chat, making the entire process faster and more accessible for everyone.

Ready to manage WordPress with AI?

Get 100,000 tokens free every month. No credit card required.

Get Your Free License Key →

More from the blog