Exporting WordPress content takes one click. Exporting it without losing anything is where most people get caught out: featured images that never arrive, a page builder layout that turns into a wall of shortcodes, custom fields that vanish, or an import that stops halfway through a 900-post blog.
This guide shows you how to export WordPress posts and pages the right way, whether you need one landing page, a hand-picked set of articles or every piece of content on the site. You will learn the built-in export tool step by step, how to export a single page in WordPress, how to export selected posts without touching their authors, how to create CSV and Excel files, how to keep images and metadata, how to import the file on another site and how to fix the errors that stop exports from finishing.
Quick answer: To export WordPress posts or pages, go to Tools → Export in your dashboard, choose Posts, Pages or All content, set any filters and click Download Export File. WordPress saves an XML file that you can bring into another site with Tools → Import → WordPress. Your original content is not changed or deleted.
Why Export WordPress Posts and Pages?
A WordPress export is a portable copy of your content. It lets you move words, structure and metadata somewhere else without dragging the whole website along. Site owners, agencies and editors use it for very different jobs:
- Moving content to a new site or domain. You are rebuilding on a fresh install, or merging two blogs into one.
- Copying a single page. A landing page, pricing page or legal page you want on a client site or a sister brand.
- Splitting a site. One category has grown big enough to deserve its own website.
- Staging to live. You wrote and designed new posts on a staging copy and now need them on production.
- Content audits and reporting. Your SEO or editorial team wants every title, slug, date and category in a spreadsheet.
- Archiving. You want an offline record of everything you have published before a redesign, rebrand or shutdown.
- Leaving a platform. You are moving from WordPress.com to self-hosted WordPress, or out of WordPress entirely.
Each job needs a slightly different method. A full redesign needs every post, page and menu. A content audit needs a CSV, not XML. A single landing page is often faster to copy than to export. The sections below match the method to the job, so you never export more (or less) than you need.
What Does Exporting WordPress Content Mean?
When you export WordPress content, WordPress reads posts, pages and related data from the database and writes them into a file you can download. Nothing on the live site changes. The export is a copy, not a move, so your posts stay exactly where they were.
The built-in exporter produces a WXR file (WordPress eXtended RSS). It is plain XML that follows the RSS format with extra WordPress fields, currently WXR version 1.2. Each post, page, product or media item becomes an <item> that stores the title, content (including block markup), slug, date, status, author, categories, tags, comments and every custom field. Authors, categories, tags and menus appear once at the top of the file.
Learning how to export WordPress website content safely starts with knowing what this file holds. Here is a trimmed example of what you will see if you open a WordPress XML export in a text editor:
<?xml version="1.0" encoding="UTF-8" ?>
<rss version="2.0"
xmlns:excerpt="http://wordpress.org/export/1.2/excerpt/"
xmlns:content="http://purl.org/rss/1.0/modules/content/"
xmlns:dc="http://purl.org/dc/elements/1.1/"
xmlns:wp="http://wordpress.org/export/1.2/">
<channel>
<title>My WordPress Site</title>
<wp:wxr_version>1.2</wp:wxr_version>
<wp:base_site_url>https://example.com</wp:base_site_url>
<!-- Authors, categories, tags and menus are listed once, at the top -->
<wp:author> <wp:author_login><![CDATA[sarah_editor]]></wp:author_login> ... </wp:author>
<wp:category> <wp:category_nicename><![CDATA[tutorials]]></wp:category_nicename> ... </wp:category>
<!-- Every post, page, product or media item is one <item> -->
<item>
<title><![CDATA[How to Export WordPress Posts]]></title>
<dc:creator><![CDATA[sarah_editor]]></dc:creator>
<content:encoded><![CDATA[<!-- wp:paragraph --><p>Blocks, HTML and shortcodes...</p><!-- /wp:paragraph -->]]></content:encoded>
<wp:post_id>1287</wp:post_id>
<wp:post_date><![CDATA[2026-11-28 09:14:00]]></wp:post_date>
<wp:post_name><![CDATA[export-wordpress-posts]]></wp:post_name>
<wp:status><![CDATA[publish]]></wp:status>
<wp:post_type><![CDATA[post]]></wp:post_type>
<category domain="category" nicename="tutorials"><![CDATA[Tutorials]]></category>
<wp:postmeta>
<wp:meta_key><![CDATA[_thumbnail_id]]></wp:meta_key>
<wp:meta_value><![CDATA[1290]]></wp:meta_value>
</wp:postmeta>
</item>
<!-- The featured image is a separate item that points to the file URL -->
<item>
<wp:post_id>1290</wp:post_id>
<wp:post_type><![CDATA[attachment]]></wp:post_type>
<wp:attachment_url><![CDATA[https://example.com/wp-content/uploads/2026/11/export.png]]></wp:attachment_url>
</item>
</channel>
</rss>
Notice the last item. Images are stored as attachment records that point to a URL, not as the image files themselves. That single detail explains most “missing images” problems, and we will come back to it in the media section.
Exporting is also different from a backup and from a full migration. An export copies content. A backup copies the whole site (files plus database) so you can restore it. A migration moves that whole site to a new server. If your goal is to move everything, theme, plugins and settings included, follow our guide on how to move a WordPress site to a new host without downtime instead.
What to Know Before Exporting WordPress Posts and Pages
Five minutes of preparation saves hours of cleanup. Run through these points before you click any export button.
Back Up Your WordPress Website
Exporting is read-only, so it cannot damage the source site. Importing is a different story: it writes hundreds of rows into the destination database, creates users and downloads files. If something goes wrong, a backup is your undo button. Take a backup of both sites, or at least of the site you are importing into. A WordPress database backup plugin is enough for content work, because posts, pages and metadata all live in the database.
- Back up the destination site (database at minimum, full backup if possible).
- Update WordPress core on both sites so the export and import code match.
- Write down the active theme and the plugins that store content (page builders, SEO, custom fields, forms).
- Empty the trash and delete spam comments so you do not export junk.
- Check how big
wp-content/uploadsis. Large media libraries need their own plan. - Turn off maintenance mode, password protection and hotlink protection on the old site, so the importer can download images.
- Note the permalink structure under Settings → Permalinks so URLs stay the same.
Understand WordPress Export File Formats
“Export” can mean several file types. Picking the right one up front is the difference between a clean import and a pile of rework.
| Format | Best for | Keeps blocks and formatting | Can be re-imported into WordPress |
|---|---|---|---|
| XML (WXR) | Moving posts, pages, comments, menus and custom fields to another WordPress site | Yes, content is copied exactly | Yes, with the free WordPress Importer |
| CSV | Spreadsheets, content audits, SEO reviews, bulk editing | Partly: HTML is kept as text in one cell | Yes, with a CSV import plugin |
| Excel (XLSX) | Reports for clients and managers | Partly | Usually after saving as CSV |
| JSON | Block patterns and plugin settings | Yes, for that pattern | Yes, through the Patterns screen or the plugin |
| ZIP | The actual media files from /uploads |
Not applicable | Copy back over SFTP or with a plugin |
| SQL | Full database copies and migrations | Yes, everything | Yes, but it replaces data rather than merging it |
| PDF or HTML | Offline reading, ebooks, legal archives | Visually only | No |
Choose the Content You Want to Export
Before exporting, answer one question: what exactly has to arrive on the other side? A single page, a category, everything, or a spreadsheet of titles? The answer decides your method.
As a rule of thumb, use the built-in exporter for most WordPress-to-WordPress moves, WP-CLI for very large sites or precise selections, a plugin for CSV, Excel and custom fields, and a full backup when you need themes, plugins and settings as well.
How to Export WordPress Posts and Pages Using the Built-in Export Tool
Every self-hosted WordPress site includes an exporter under the Tools menu. It needs no plugin, it is free, and it produces the WXR file that the official importer expects. Here is how to export WordPress posts and pages with it.
Step 1: Log in to Your WordPress Dashboard
Sign in at yoursite.com/wp-admin with an Administrator account. The export screen requires the export capability, which only administrators have by default. Editors and authors will not see the menu item. On a multisite network, each site has its own export screen, so open the dashboard of the subsite you want to export.
Step 2: Navigate to Tools → Export
In the left sidebar, hover over Tools and click Export. WordPress shows a short explanation of the WXR format and a list headed Choose what to export.

Step 3: Select Posts or Pages
You can only pick one option at a time:
- All content exports posts, pages, comments, custom fields, terms, navigation menus and custom post types in one file. It is the only option that includes menus.
- Posts exports blog posts only and unlocks four filters.
- Pages exports pages only and unlocks three filters. Choose it when you want to export pages from WordPress without blog posts mixed in.
- Custom post types such as Products, Portfolio or Testimonials appear here when a plugin or theme registers them as exportable.
- Media exports media library records (titles, captions, alt text and file URLs) filtered by upload date.
Step 4: Choose Export Filters
Filters are where you control exactly what lands in the file. When you select Posts, the WordPress export posts screen lets you filter by Categories, Authors, a Start date and End date, and Status (Published, Draft, Pending, Private, Scheduled and so on). Filters stack, so the screenshot below exports only published posts in the Tutorials category from January to June 2026.

Three details are worth knowing:
- Dates work by month. The drop-downs list months, not days, and the end month is included in full. They use the publish date, not the last-modified date.
- Only one category or author at a time. For two categories, run two exports or use the methods in the selected posts section.
- Featured images come along. Since WordPress 6.5, exporting a single content type also includes the featured images and the media attached to those posts. On older versions, filtered exports skipped them, which is why older tutorials tell you images go missing.
Step 5: Download the Export File
Click Download Export File. Your browser saves an XML file named after the site and today’s date, for example mywordpresssite.WordPress.2026-12-06.xml. Small blogs export in seconds. Sites with thousands of posts can take a minute or more, so leave the tab open until the download starts.
Open the file in a code editor before you use it. The first line should be <?xml version="1.0" encoding="UTF-8" ?>, you should see <wp:wxr_version>1.2</wp:wxr_version> near the top, and the file should end with </rss>. If it ends abruptly, the export was cut short; see the troubleshooting section below.
Privacy note: A WordPress XML export contains author email addresses and, when comments are included, commenter names, emails and IP addresses. Treat the file as personal data: do not email it around, do not upload it to public folders, and delete copies you no longer need.
How to Export a Single Page in WordPress
The built-in exporter has no “export this page” button, which is why “how to export a page in WordPress” is one of the most searched WordPress questions. You still have four reliable ways to export a page from WordPress, and none of them needs a paid tool.
Method 1: Copy All Blocks (Fastest, No Plugin)
If the page was built with the block editor, you can copy its complete block markup and paste it into a page on any other WordPress site. Formatting, columns, buttons, spacing and block settings come across intact.
- Open the page in the editor (Pages → All Pages → Edit).
- Click the Options menu (the three vertical dots in the top-right corner).
- Under Tools, click Copy all blocks. WordPress confirms with “All content copied.”
- On the other site, create a new page, click into the editor and paste with Ctrl + V (or Cmd + V on a Mac).

Two things do not travel with the clipboard: the page’s featured image, SEO title and custom fields, and the image files themselves (the pasted blocks still point to the old site’s URLs). Upload the images to the new site and swap them in, or use one of the next methods if you need metadata too. Prefer a file instead of the clipboard? Switch to the Code editor (Ctrl + Shift + Alt + M), copy everything and save it as a .html text file for your archive.
Method 2: Narrow the Built-in Export Filters
When you need the page’s metadata as well, use the built-in WordPress page export and filter it down until only your page matches. Select Pages, choose the page’s author, and set the start and end date to the month the page was published.

If other pages share the same author and month, they will be in the file too. That is usually harmless: on the destination site, delete the extras after import. It is safer than the common advice to temporarily reassign a post to a dummy author, which changes live content and can confuse your SEO plugin’s author archives.
Method 3: Export One Page With WP-CLI
If your host gives you SSH access (most managed WordPress hosts do), the wp export command can export exactly one post or page by ID. First find the ID. You can also hover over the page title in Pages → All Pages and read the post=42 part of the edit link.
# List pages with their IDs (use --post_type=post for posts)
wp post list --post_type=page --fields=ID,post_title,post_status
# Or search by title
wp post list --post_type=page --s="About Us" --fields=ID,post_title
Then export it. The --with_attachments flag adds the featured image and attached media, which --post__in skips by default.
# Export page ID 42 plus its featured image and attached media
wp export --post__in=42 --with_attachments --dir=~/exports

Method 4: Use a Plugin Filter or a Pattern
Export plugins such as WP All Export and WP Import Export Lite let you add a rule like “ID equals 42” or “Title contains Pricing” before exporting, and they output XML or CSV. If you only need a reusable section rather than a whole page (a hero, a pricing table, a footer call-to-action), turn it into a pattern: select the blocks, choose Create pattern, then in Appearance → Editor → Patterns (or Appearance → Patterns on classic themes) open the pattern’s actions menu and choose Export as JSON. The other site can import that JSON file from the same screen.
How to Export Selected WordPress Posts
Maybe you want twelve evergreen articles for a new niche site, or every post a guest writer contributed. The exporter’s filters cannot pick posts one by one, but there are three clean ways to export selected WordPress posts.
Option 1: The Temporary Category Trick (No Plugin)
- Go to Posts → Categories and create a category named Export batch.
- Open Posts → All Posts, tick the posts you want, choose Edit from Bulk actions and click Apply.
- Tick Export batch in the category list and click Update. Existing categories are kept; this only adds one.
- Go to Tools → Export, select Posts, set Categories to Export batch and download the file.
- Delete the Export batch category. Your posts keep their original categories and nothing else changes.
After importing, delete the Export batch category on the new site too, or rename it into something useful.
Option 2: Pass a List of IDs to WP-CLI
WP-CLI accepts a list of post IDs, and it can build that list for you from any query, such as a tag, an author or the most recent posts.
# Export three hand-picked posts (IDs from Posts > All Posts)
wp export --post__in=128,245,311 --with_attachments --dir=~/exports
# Export every post that has the "featured" tag
wp export --post__in="$(wp post list --tag=featured --format=ids)" --with_attachments --dir=~/exports
# Export the 50 newest published posts
wp export --post__in="$(wp post list --post_status=publish --posts_per_page=50 --format=ids)" --with_attachments --dir=~/exports
Option 3: Use Rule-Based Plugin Filters
WP All Export and similar plugins let you build rules such as “Category is Recipes AND Date is newer than 2025-01-01 AND Status is publish”. This is the most flexible option when the selection depends on custom fields, for example every product review with a rating of 4 or higher.
How to Export All WordPress Posts and Pages at Once
To export all WordPress posts and pages in one file, go to Tools → Export, leave All content selected and click Download Export File. This is the right choice when you are moving a whole blog to a fresh WordPress install, because it is the only option that includes navigation menus, and it bundles every exportable custom post type into the same file.
On large sites, one giant XML file becomes a problem at import time: upload limits, PHP timeouts and memory errors. You have two ways around it:
- Split by date in the dashboard. Export Posts year by year (January to December of each year), then export Pages separately, then run one All content export only if you need menus.
- Split automatically with WP-CLI. The command below writes as many files as needed, each around 10 MB. The default is 15 MB.
# Everything the built-in exporter includes, split into files of about 10 MB
wp export --dir=~/exports --max_file_size=10
# Only posts and pages (skip products, portfolio items and other custom post types)
wp export --post_type=post,page --dir=~/exports
# Leave comments out to keep the file small
wp export --post_type=post,page --skip_comments --dir=~/exports
Remember that “all content” is still content only. Themes, plugins, widgets and settings are not included. If that is what you actually need, use a backup or migration plugin rather than the exporter.
How to Export WordPress Posts by Category, Author, or Date
Filtered exports are perfect for splitting a site, handing a writer their own archive or moving one content silo. Here is what each filter can do in the dashboard and its WP-CLI equivalent.
| Filter | Posts | Pages | Media | WP-CLI flag |
|---|---|---|---|---|
| Category | Yes (one) | No | No | --category=tutorials |
| Author | Yes (one) | Yes (one) | No | --author=sarah_editor |
| Date range | By month | By month | By month | --start_date / --end_date (by day) |
| Status | Yes | Yes | No | --post_status=publish |
| Specific IDs | No | No | No | --post__in=12,45 |
A few practical examples:
- By category: moving your “Recipes” section to a new food blog? Select Posts, pick the Recipes category, leave the dates empty and download.
- By author: a freelance writer wants a portfolio copy of their work. Filter by their name and status Published.
- By date: splitting a 10-year archive into yearly files keeps each import small and easy to retry.
# By category (slug or ID)
wp export --post_type=post --category=tutorials --dir=~/exports
# By author (login or user ID)
wp export --post_type=post --author=sarah_editor --dir=~/exports
# By date: posts published January to June 2026
wp export --post_type=post --start_date=2026-01-01 --end_date=2026-07-01 --dir=~/exports
# Stack filters: published tutorials by one author
wp export --post_type=post --category=tutorials --author=sarah_editor --post_status=publish --dir=~/exports
How to Export Blog Posts From WordPress Using a Plugin
The built-in tool covers most WordPress-to-WordPress moves. Plugins step in when you need spreadsheets, specific fields, scheduled exports, widgets and Customizer settings, or media files in one package. These are the ones worth knowing.
WP All Export
WP All Export is the most popular dedicated export plugin, with more than 100,000 active installations. Instead of a fixed XML layout, you drag the fields you want (title, content, slug, categories, featured image URL, any custom field) into columns, add filter rules and download the result. The free version exports CSV and XML; Excel files, scheduled exports, user exports and Zapier or Google Sheets delivery are part of the paid edition.
- Install and activate WP All Export from Plugins → Add New Plugin.
- Go to All Export → New Export and choose Posts, Pages or a custom post type.
- Optionally add filtering rules (category, date, status, custom field values).
- Click Customize Export File and drag fields into the column builder.
- Choose CSV or XML, click Confirm & Run Export and download the file. A bundle download also includes import settings for its sister plugin, WP All Import.
Pros
- Pick exactly which fields become columns
- Rule-based filters, including custom fields
- Handles WooCommerce products and ACF data
Cons
- One post type per export in the free version
- Excel, scheduling and user exports cost extra
- More screens than the built-in tool
Advanced WordPress Export
Advanced Export (by AddonsPress) fills the biggest gap in the core exporter: it packages posts, pages, custom post types, widgets, theme options and the actual media files into one ZIP. You run it from Tools → Advanced Export and restore the ZIP on the other site with its companion plugin, Advanced Import. Theme developers use it to build demo content packages, and it is handy when you want a site’s content and layout settings together without a full backup.
Pros
- Includes widgets, Customizer options and media files
- Single ZIP is easy to store or hand over
- Free
Cons
- Needs the Advanced Import plugin on the other side
- Large media libraries create very large ZIPs
- Not a replacement for a real backup
Other Useful Export Plugins
| Plugin | Best for | Formats | Free version |
|---|---|---|---|
| WP Import Export Lite | Posts, pages, custom post types, taxonomies, comments and users with drag-and-drop fields and background processing | CSV, XLS, XLSX, XML, JSON, ODS, TXT | Yes; scheduling is premium |
| WP Ultimate CSV Importer + WP Ultimate Exporter | Two-way spreadsheet work, including custom fields and SEO data | CSV, XML, Excel | Yes; scheduled exports are Pro |
| Simple CSV/XLS Exporter | Quick spreadsheets of selected post types and fields | CSV, XLS | Yes |
| Customizer Export/Import | Theme Customizer settings the XML export leaves behind | DAT | Yes |
| Print My Blog | Printing posts or saving them as one PDF through your browser | Print, PDF (ePub and Word in Pro) | Yes |
| Media Library File Download | Downloading the whole media library as one ZIP | ZIP | Yes |
| WooCommerce (built in) | Products, from the Export button on Products → All Products | CSV | Yes |
For a wider roundup of free tools that move data in and out of WordPress, Speckyboy’s 2026 list of free import and export WordPress plugins is a good place to compare options.
Tip: Keep export plugins installed only while you need them. They have access to all of your content, so deactivate and delete them once the job is done.
How to Export WordPress Posts and Pages to CSV or Excel
CSV is the format for people rather than for WordPress: content inventories, SEO audits, editorial calendars, redirect planning and client reports. WordPress has no CSV option of its own, but you have four good ways to export WordPress posts to CSV.
Option 1: WP All Export (Free)
Follow the steps above, choose CSV as the format, and drag in the fields your spreadsheet needs. This is the easiest route for non-developers and the only one here that handles complex custom fields without code.
Option 2: A Small Code Snippet (No Plugin)
The snippet below adds Export posts to CSV and Export pages to CSV buttons to the bottom of Tools → Export. It exports ID, title, slug, status, date, author, categories, tags, featured image URL, permalink and excerpt. It checks the user’s export permission and a security nonce, processes posts in batches of 200 so large sites do not run out of memory, adds a UTF-8 marker so Excel shows accented characters correctly, and neutralizes cells that start with =, +, - or @ so spreadsheets cannot run them as formulas.
Save it as wp-content/mu-plugins/export-posts-csv.php. Create the mu-plugins folder if it is not there. Files in that folder run automatically, so there is nothing to activate, and you can delete the file when you are done.
<?php
/**
* Plugin Name: Export Posts and Pages to CSV
* Description: Adds "Export posts to CSV" and "Export pages to CSV" buttons to Tools > Export. No settings, no database tables.
* Version: 1.0.0
* Requires PHP: 7.4
*
* Save as wp-content/mu-plugins/export-posts-csv.php (create the mu-plugins folder if it does not exist).
*/
defined( 'ABSPATH' ) || exit;
/**
* 1. Print two CSV buttons at the bottom of Tools > Export.
*/
add_action(
'export_filters',
function () {
foreach ( array( 'post' => 'Export posts to CSV', 'page' => 'Export pages to CSV' ) as $type => $label ) {
$url = wp_nonce_url(
admin_url( 'admin-post.php?action=export_posts_csv&post_type=' . $type ),
'export_posts_csv'
);
printf( '<a class="button" style="margin:4px 8px 4px 0" href="%s">%s</a>', esc_url( $url ), esc_html( $label ) );
}
}
);
/**
* 2. Stream the CSV file when a button is clicked.
*/
add_action(
'admin_post_export_posts_csv',
function () {
if ( ! current_user_can( 'export' ) ) {
wp_die( esc_html__( 'Sorry, you are not allowed to export the content of this site.' ), 403 );
}
check_admin_referer( 'export_posts_csv' );
$post_type = isset( $_GET['post_type'] ) ? sanitize_key( wp_unslash( $_GET['post_type'] ) ) : 'post';
if ( ! in_array( $post_type, array( 'post', 'page' ), true ) ) {
$post_type = 'post';
}
// Stop spreadsheet apps from running cell values as formulas (CSV injection).
$cell = static function ( $value ) {
$value = (string) $value;
return preg_match( '/^[=+\-@\t\r]/', $value ) ? "'" . $value : $value;
};
nocache_headers();
header( 'Content-Type: text/csv; charset=utf-8' );
header( 'Content-Disposition: attachment; filename=wordpress-' . $post_type . 's-export-' . gmdate( 'Y-m-d' ) . '.csv' );
$out = fopen( 'php://output', 'w' );
fwrite( $out, "\xEF\xBB\xBF" ); // UTF-8 BOM so Excel shows accented letters correctly.
fputcsv( $out, array( 'ID', 'Title', 'Slug', 'Status', 'Date', 'Author', 'Categories', 'Tags', 'Featured image URL', 'Permalink', 'Excerpt' ), ',', '"', '' );
$paged = 1;
do {
$query = new WP_Query(
array(
'post_type' => $post_type,
'post_status' => array( 'publish', 'future', 'draft', 'pending', 'private' ),
'posts_per_page' => 200,
'paged' => $paged,
'orderby' => 'ID',
'order' => 'DESC',
)
);
foreach ( $query->posts as $post ) {
$categories = 'post' === $post_type ? wp_get_post_terms( $post->ID, 'category', array( 'fields' => 'names' ) ) : array();
$tags = 'post' === $post_type ? wp_get_post_terms( $post->ID, 'post_tag', array( 'fields' => 'names' ) ) : array();
$row = array(
$post->ID,
$post->post_title,
$post->post_name,
$post->post_status,
$post->post_date,
get_the_author_meta( 'user_login', $post->post_author ),
is_array( $categories ) ? implode( '|', $categories ) : '',
is_array( $tags ) ? implode( '|', $tags ) : '',
(string) get_the_post_thumbnail_url( $post, 'full' ),
get_permalink( $post ),
wp_strip_all_tags( $post->post_excerpt ),
);
fputcsv( $out, array_map( $cell, $row ), ',', '"', '' );
}
$paged++;
} while ( $paged <= $query->max_num_pages );
fclose( $out );
exit;
}
);
Open the file in Excel, Google Sheets, Numbers or LibreOffice. Categories and tags are separated with a pipe (|) so they stay in one cell.

Option 3: WP-CLI One-Liners
With SSH access, wp post list writes any post fields straight to CSV, which is ideal for quick audits and scripts.
# Published posts to CSV
wp post list --post_type=post --post_status=publish --fields=ID,post_title,post_name,post_date,post_status --format=csv > posts.csv
# All pages, any status, to CSV
wp post list --post_type=page --post_status=any --fields=ID,post_title,post_name,post_parent,post_status --format=csv > pages.csv
Option 4: Convert the XML Export to Excel
Already have a WordPress XML export? Drop it into our free XML to Excel converter to turn the items into rows you can sort and filter, without installing anything on the site.
Excel tip: If accented letters or emoji look broken, open Excel, go to Data → From Text/CSV, select the file and set File origin to 65001: Unicode (UTF-8). Long numeric IDs stay correct when you import them as text.
How to Export WordPress Content Using XML
XML is the native WordPress export format and the one to choose whenever the content is going into another WordPress site, whether you export WordPress pages to XML, a single category or a full blog. It is the only format that rebuilds posts, pages, comments, categories, tags, menus, parent-child page relationships and custom fields in one pass. The official Tools Export Screen documentation describes it as the file you bring into another installation with Tools → Import → WordPress.
Three places create a WordPress XML export:
- Self-hosted WordPress: Tools → Export, as shown above, or
wp exporton the command line. - WordPress.com: Tools → Export → Export all. You receive a ZIP by email or download; unzip it and import the XML inside into your self-hosted site.
- Plugins: WP All Export, WP Import Export Lite and others write a WordPress post export in custom XML layouts. Those files are meant for their own importers, not for the WordPress Importer.
If you work with exports often, these three filters make the files easier to manage. Add them to a small must-use plugin or your child theme’s functions.php. The first renames the download to include the content type and time, the second leaves editor-only meta keys out of the file, and the third makes a custom post type appear on the export screen when the plugin that registers it disabled exporting.
<?php
// 1. Give export files a clearer name: mysite-post-export-2026-12-06-1430.xml
add_filter( 'export_wp_filename', function ( $filename, $sitename, $date ) {
$type = isset( $_GET['content'] ) ? sanitize_key( wp_unslash( $_GET['content'] ) ) : 'all';
return rtrim( $sitename, '.' ) . '-' . $type . '-export-' . gmdate( 'Y-m-d-Hi' ) . '.xml';
}, 10, 3 );
// 2. Leave noisy editor meta out of the XML (WordPress already skips _edit_lock)
add_filter( 'wxr_export_skip_postmeta', function ( $skip, $meta_key ) {
return in_array( $meta_key, array( '_edit_last', '_pingme', '_encloseme' ), true ) ? true : $skip;
}, 10, 2 );
// 3. Make a custom post type exportable when its plugin set can_export to false
add_filter( 'register_post_type_args', function ( $args, $post_type ) {
if ( 'portfolio' === $post_type ) { // Change to your post type key.
$args['can_export'] = true;
}
return $args;
}, 10, 2 );
WordPress.org is also investing in better ways to move content. Its Data Liberation project collects migration guides and is building improved import and export tools, so expect this area to keep improving.
Do not edit the XML by hand unless you have to. A single broken character inside
<![CDATA[ ]]>makes the whole file unreadable for the importer. If you must change the domain inside the file, use a proper find-and-replace in a code editor and keep a copy of the original.
How to Export WordPress Media Files and Featured Images
Here is the part most guides skip: the WordPress export file does not contain your images. Selecting Media on the export screen exports media records: the title, caption, description, alt text and the URL of each file. The files themselves stay in wp-content/uploads on the old server.
During import, the WordPress Importer reads each URL and downloads the file from the old site. When the old site is online and reachable, this works well. When it is not, images go missing.
You have three ways to make sure media arrives:
- Let the importer download the files. Keep the old site online, tick Download and import file attachments during import, and you are done. Best for small and medium sites.
- Copy the uploads folder yourself. Download
wp-content/uploadswith SFTP or your host’s file manager (compress it to a ZIP first), upload it to the same path on the new site, then import with--source-dirso WordPress uses the local files. Best for large libraries and offline sites. - Use a media export plugin. Media Library File Download can package the whole library as a ZIP from the dashboard when you have no server access.
# On the OLD server: pack the uploads folder (run from the WordPress root)
zip -r uploads-2026-12-06.zip wp-content/uploads
# Or copy it straight to the NEW server over SSH
rsync -avz wp-content/uploads/ user@new-server:/var/www/html/wp-content/uploads/
# On the NEW server: rebuild thumbnail sizes for your current theme
wp media regenerate --yes
Featured images: WordPress 6.5 and newer automatically add featured images and attached media to filtered exports of posts or pages. On older installations, export Media for the same date range as a second file, or use All content. After any import, regenerate thumbnails so every image size your new theme uses exists. If your library is messy after the move, a WordPress media manager plugin helps sort files into folders.
How to Export WordPress Posts and Pages Without Losing Images, Metadata, or Formatting
Content rarely disappears during an export. It disappears during the import, because the new site is missing something the content depends on. This table lists everything that commonly goes missing and how to keep it.
| What can go missing | Why it happens | How to keep it |
|---|---|---|
| Images in post content | The importer could not download them from the old site | Keep the old site online, or copy /uploads and use --source-dir |
| Featured images | Filtered export on WordPress older than 6.5 | Update WordPress, or export Media for the same dates |
| Thumbnail sizes | The new theme registers different image sizes | Run wp media regenerate or a thumbnail plugin |
| Custom fields (ACF, Meta Box) | Values import, but the field groups do not exist yet | Export field groups (ACF → Tools) and import them first |
| Page builder layouts | Layout data lives in post meta and needs the same builder | Install the same builder before importing, then regenerate its CSS |
| Block styles and theme patterns | They come from the theme and theme.json | Use the same theme, or a child theme of it |
| Shortcodes | The plugin that renders them is not installed | Install the same plugins, or replace shortcodes with blocks |
| SEO titles and descriptions | Saved as post meta by Yoast SEO, Rank Math and similar | Install the same SEO plugin before the import |
| Menus | Only included with All content | Use All content, then assign menu locations |
| Widgets and Customizer settings | Not part of WXR at all | Customizer Export/Import or Advanced Export |
| Internal links | They still point to the old domain | Tick the URL rewrite option, or run a search-replace |
| WooCommerce orders | New stores keep orders in their own tables (HPOS) | Use a WooCommerce order export plugin or a full migration |
The golden rule follows from that table: set up the destination site first, import second. Install the same theme (here is how to install a WordPress theme if you are starting from scratch), activate the same content plugins, match the permalink structure, and only then run the import. Do it in that order and posts arrive looking exactly as they did on the original site.
Finally, verify. Count your content on both sites and compare the numbers:
# Count content on BOTH sites and compare the numbers
wp post list --post_type=post --post_status=any --format=count
wp post list --post_type=page --post_status=any --format=count
wp post list --post_type=attachment --format=count
wp comment list --format=count
No SSH access? Run this query in phpMyAdmin on both databases instead:
-- phpMyAdmin > SQL tab (change wp_ if your table prefix is different)
SELECT post_type, post_status, COUNT(*) AS total
FROM wp_posts
WHERE post_type IN ('post', 'page', 'attachment')
GROUP BY post_type, post_status
ORDER BY post_type, post_status;
How to Import Exported WordPress Posts and Pages Into Another Website
Exporting is half the job. Here is how to migrate WordPress posts and pages into the new site with the official WordPress Importer plugin. Try it on a staging copy or a local WordPress install first if the site matters to you.
- On the destination site, go to Tools → Import.
- Under WordPress, click Install Now, then Run Importer.
- Click Choose File, select your XML file and click Upload file and import.

- Assign Authors. For each author in the file, either create a new user or assign their posts to an existing user, such as your own admin account.
- Import Attachments. Tick Download and import file attachments. Without it, images are not copied.
- Content Options. Leave Change all imported URLs that currently link to the previous site so that they now link to this site ticked when moving to a new domain. Recent importer versions offer this on WordPress 6.7 and newer.
- Click Submit and wait for “All done. Have fun!” Do not close the tab while it runs.

The importer then reminds you to update the passwords and roles of imported users. New users get a random password and the default role from Settings → General, so send them a password reset link.
On big imports, WP-CLI is faster and has no upload limit:
# The importer must be installed first
wp plugin install wordpress-importer --activate
# Import, creating any missing authors
wp import mywordpresssite.WordPress.2026-12-06.xml --authors=create
# Import and point links at the new domain (WordPress Importer 0.9.1+)
wp import mywordpresssite.WordPress.2026-12-06.xml --authors=skip --rewrite_urls
# Old site offline? Use the uploads folder you copied instead of downloading files
wp import mywordpresssite.WordPress.2026-12-06.xml --authors=skip --source-dir=/var/www/html/wp-content/uploads
# Import several split files in one go
wp import ~/exports/ --authors=skip --skip=image_resize
After-Import Checklist
- Go to Settings → Permalinks and click Save Changes to refresh rewrite rules.
- Assign imported menus to locations under Appearance → Menus (or the Site Editor’s Navigation).
- Set the homepage and posts page again under Settings → Reading.
- Open a few posts and pages and check images, embeds, tables and buttons.
- Regenerate page builder CSS (for Elementor: Elementor → Tools → Regenerate Files & Data).
- Scan for dead links with a broken link checker plugin.
- If the domain changed, add 301 redirects from the old URLs so you keep rankings and backlinks.
Common WordPress Export Problems and How to Fix Them
Most export and import failures come down to server limits, unreachable images or a destination site that is not ready. Here is how to diagnose and fix each one.
WordPress Export File Not Downloading
Symptoms: you click Download Export File and get a blank screen, a spinning tab, a 500 error, or a tiny file that stops halfway.
- PHP memory or time limit: the exporter builds the whole file in one request. Raise the limits in
wp-config.phpand ask your host to raisemax_execution_time. - A plugin conflict: security, caching and “coming soon” plugins sometimes block
export.phpor print text before the XML. Deactivate them for a minute and try again. - Too much at once: export Posts and Pages separately, or year by year.
- Server errors: if you see a white page or a 500 internal server error, turn on logging below and read
wp-content/debug.logfor the exact cause.
// wp-config.php: add above the line /* That's all, stop editing! */
define( 'WP_MEMORY_LIMIT', '256M' );
define( 'WP_MAX_MEMORY_LIMIT', '512M' ); // Admin screens such as Tools > Export use this one.
// wp-config.php: log errors to wp-content/debug.log without showing them to visitors
define( 'WP_DEBUG', true );
define( 'WP_DEBUG_LOG', true );
define( 'WP_DEBUG_DISPLAY', false );
Export File Is Too Large
The import screen shows a Maximum size next to the upload field. That is your server’s upload limit, often 2 MB to 64 MB on shared hosting. If your XML is bigger:
- Split the export by date range or content type, as described earlier, or with
wp export --max_file_size=10. - Leave comments out with
--skip_commentsif you do not need them. - Increase the maximum upload file size in WordPress on the destination site.
- Skip the browser entirely and import over SSH with
wp import, which has no upload limit.
; php.ini or .user.ini in the WordPress root
memory_limit = 512M
max_execution_time = 300
upload_max_filesize = 128M
post_max_size = 128M
Missing Images or Media Files
- “Download and import file attachments” was not ticked. Run the import again with it ticked. Existing posts are skipped, so you will not get duplicates.
- The old site is offline, password protected, in maintenance mode or behind a firewall that blocks server-to-server requests. Make it reachable for the duration of the import, or copy
/uploadsand use--source-dir. - Images still load from the old domain. Content was imported but URLs were not rewritten. Run a search-replace, preview first with
--dry-run. Our guide to changing URLs in the WordPress database covers the phpMyAdmin route. - Images exist but look blurry or cropped. Regenerate thumbnails for the new theme’s image sizes.
# Preview first: what would change?
wp search-replace 'https://old-site.com' 'https://new-site.com' --skip-columns=guid --dry-run
# Run it for real once the preview looks right
wp search-replace 'https://old-site.com' 'https://new-site.com' --skip-columns=guid
Missing Custom Fields and Metadata
- The values are in the database, but you cannot see them. The plugin that displays them (ACF, Meta Box, Pods, your SEO plugin) is not active, or its field groups were not imported. Install it, import the field groups, and the data reappears.
- A custom post type is missing from the export screen. The plugin registered it with
can_exportset to false. Use theregister_post_type_argssnippet in the XML section, or export it with WP All Export. - Plugin data lives in custom tables. Form entries, WooCommerce HPOS orders, LMS progress and similar data are not stored as posts, so WXR cannot include them. Use the plugin’s own export feature or a full database migration.
Incomplete WordPress Export
- The import stopped partway. Upload the same file again. The importer skips any post that already exists with the same title, date and post type, and continues with the rest.
- “This does not appear to be a WXR file, missing/invalid WXR version number”. Something was printed before the XML began: a PHP warning, a blank line or a stray character from a plugin or theme. Open the file and delete everything above
<?xml, then fix the source of the output before exporting again. - Some posts are missing. Check your filters: status, author and dates. “All” statuses export drafts and scheduled posts too, but auto-drafts are always skipped.
- Counts do not match. Use the WP-CLI or SQL counts above to find which post type is short, then export just that type again.
Frequently Asked Questions (FAQs)
Does exporting WordPress posts delete the original content?
No. Exporting only reads your content and writes a copy into a file. Posts, pages, comments and media stay exactly where they are, and visitors see no change. Content is only added, never removed, when you import the file somewhere else.
Can I export a single page from WordPress?
Yes. The quickest way is Options → Copy all blocks in the block editor and pasting into a page on the other site. To keep metadata such as the featured image and SEO fields, export with wp export --post__in=ID --with_attachments, narrow Tools → Export → Pages by author and month, or use a plugin filter on the page ID.
How do I export all blog posts from WordPress?
Go to Tools → Export, select Posts, leave every filter on All and click Download Export File. To include pages, menus and custom post types too, select All content instead. Very large blogs should export year by year or use wp export --max_file_size=10 to split the file.
Can I export WordPress posts to CSV?
Not with the built-in tool, which only creates XML. Use WP All Export (CSV is free), the code snippet in this guide that adds CSV buttons to Tools → Export, wp post list --format=csv on the command line, or convert your XML export with an XML to Excel converter.
Does WordPress export include images?
It includes image records and URLs, not the image files. During import, ticking Download and import file attachments makes WordPress download each file from the old site. If the old site is offline, copy the wp-content/uploads folder manually. Since WordPress 6.5, exporting posts or pages also includes their featured images and attached media records.
How do I export posts from one WordPress site to another?
Export from the old site with Tools → Export. On the new site, install the same theme and content plugins, then go to Tools → Import → WordPress, install and run the importer, upload the XML file, map the authors, tick Download and import file attachments and submit. Finish by saving permalinks, assigning menus and checking a few posts.
What is the difference between WordPress export and backup?
An export is a portable copy of your content (posts, pages, comments, terms and metadata) that you can bring into any WordPress site. A backup is a copy of the entire site (every file plus the full database) that restores it to an earlier state. Use exports to move or reuse content, and backups to protect the site.
Can I export WordPress pages without a plugin?
Yes. Tools → Export → Pages is built into every WordPress site, and you can filter pages by author, date and status. For a single page, use Copy all blocks in the editor or wp export --post__in if you have SSH access. Neither needs a plugin.
How do I download WordPress posts from WordPress.com?
In your WordPress.com dashboard, go to Tools → Export and choose Export all. WordPress.com prepares a ZIP file that contains the XML export. Unzip it and import the XML on your self-hosted site with the WordPress Importer. Media files can be downloaded separately from the same screen.
Is there a size limit for WordPress export files?
The exporter has no fixed limit, but your server does: PHP memory and time limits affect exporting, and the upload limit (shown as Maximum size on the import screen) affects importing. Split large exports by date or content type, raise the limits, or use WP-CLI, which avoids browser upload limits altogether.
Conclusion
Now you know how to export WordPress pages and posts for any situation, and it is simple once you match the method to the job. For most moves, Tools → Export and the free WordPress Importer are all you need. For a single page, copy all blocks or use wp export --post__in. For hand-picked posts, use the temporary category trick or a list of IDs. For spreadsheets and audits, export WordPress posts to CSV with WP All Export or the snippet above. For very large sites, let WP-CLI split the files for you.
And to export without losing content, remember the three rules from this guide:
- Images travel as URLs. Keep the old site reachable or copy the uploads folder.
- Prepare the destination first. Same theme, same content plugins, same permalinks, then import.
- Verify the numbers. Count posts, pages, media and comments on both sites before you call it done.
Follow those whenever you export posts and pages from WordPress, and your content, images and metadata arrive on the other side exactly as you left them.

