Guide

Command line reference

Every flag wpexportjson export accepts, what it defaults to, and the configuration-file form of the same settings — plus the checkpoint that makes an interrupted export resumable instead of a restart.

Usage

Basic Export

1wpexportjson export --url https://your-wordpress-site.com

Advanced Options

1wpexportjson export \
2  --url https://your-wordpress-site.com \
3  --format markdown \
4  --output ./my-export \
5  --brute-force \
6  --max-id 10000 \
7  --download-media \
8  --concurrent 10

Configuration File

Create a config.yaml file:

1url: "https://your-wordpress-site.com"
2output: "./export"
3format: "json"
4brute_force: true
5max_id: 10000
6download_media: true
7concurrent: 10

Then run:

1wpexportjson export --config config.yaml

Command line options

Option Description Default
--urlWordPress site URLRequired
--outputOutput directory or file./export
--formatExport format (json/ markdown/ ssg/ shopify/ magento/ wordpress/ drupal/ wix/ squarespace/ webflow/ weebly/ prestashop/ ghost/ strapi/ contentful)json
--brute-forceEnable brute force ID discoveryfalse
--max-idMaximum ID for brute force10000
--scan-rangeRescan a specific inclusive ID range for posts/pages/media, e.g. 100-200. It adds to what the listing walk found — it does not replace the walk, so it cannot be used to avoid a listing page the site will not serve""
--max-media-mbPer-file media download size cap in MB (0 = built-in default of 2048)0
--download-mediaDownload images and videostrue
--no-mediaDisable media downloads (alias for --download-media=false)false
--relevant-media-onlyDownload only featured images and media linked in content (images, PDFs, videos, etc.)false
--exclude-media-typesMedia types to skip downloading (comma-separated: images,videos,audio,documents,archives,pdf,gif). The listing is what states a file's type, so this cannot skip listing pages-
--media-path-styleForm of rewritten media paths: root (/media/…, resolves at any URL depth) or relative (media/…)root
--link-styleForm of link/canonical_url/hreflangs: absolute (source URL) or root (root-relative path)absolute
(root for ssg)
--extract-metaWhich meta tags to keep beyond the named SEO fields: all, none, or a comma-separated allow-listall
--report-a11yWrite a11y-report.md flagging WCAG 2.2 contrast and missing alt-text issuesfalse
--concurrentConcurrent downloads5
--zipCreate ZIP archive of exportfalse
--no-filesRemove export files after creating ZIP (requires --zip)false
--no-postsSkip exporting blog postsfalse
--no-pagesSkip exporting pagesfalse
--no-productsSkip exporting WooCommerce productsfalse
--no-custom-typesSkip the custom post types a theme or plugin registeredfalse
--custom-typesExport only these custom types (comma-separated slugs, e.g. cpt_services,cpt_portfolio)-
--skip-unaddressable-typesDrop custom types whose every entry is published at a query-string address (/?modula-gallery=1289) — a plugin's data store rather than pages. Off by default: a site on plain permalinks publishes everything that wayfalse
--no-usersSkip exporting usersfalse
--no-tagsSkip exporting tagsfalse
--no-menusSkip exporting navigation menus (they need authentication — see the navigation menus guide)false
--no-commentsSkip exporting reader commentsfalse
--path-filterFilter posts/pages by URL path pattern (e.g., /fr/arts/)-
--flat-htmlConvert HTML to Markdown (Bricks Builder, Elementor support)false
--basic-htmlClean HTML to basic elements (tables, lists, links - for Shopify)false
--ssg-sectionsMarkdown: emit ## Excerpt/## Content sections and omit the duplicate body H1 (for ssg)false
--preserve-classesCSS classes whose elements travel as HTML rather than being converted (comma-separated, wildcards like klaviyo-form-*). Applies to markdown/ssg as well as --flat-html and --basic-html — a heading's class is where a theme keeps its colour, and Markdown has nowhere to put it-
--preserve-stylingHow much a conversion holds on to when it cannot express a class: auto (keep a heading whose classes mean something), none (convert everything, the 1.8.14 behaviour), all (keep every element carrying a class)auto
--boilerplate-classesClasses this theme stamps on everything and that mean nothing a ## is missing, added to the ones every WordPress emits (comma-separated, wildcards)-
--crawl-content-modeWhich pages --crawl-content re-reads: auto (empty bodies and page-builder scaffolding), empty (only empty, the 1.8.14 question), alwaysauto
--builder-classesClass prefixes marking this site's page-builder markup, added to the recognized ones — the next builder is on nobody's list (comma-separated, wildcards)-
--content-selectorWhere this theme keeps the page: tag, .class, #id or tag.class, tried before the built-in list (comma-separated)-
--max-sitemap-documentsRead at most N child documents of a sitemap index. 0 (the default) reads them all; a bound makes the run name the documents it skipped0
--post-loop-markersThis theme's listing elements — shortcode, block or class names — added to the recognized ones (comma-separated)-
--read-more-phrasesThe read-more text this theme appends, for a site with too few excerpts for the run to learn it from their repetition (comma-separated)-
--preserve-idsElement IDs whose elements travel as HTML rather than being converted (comma-separated, wildcards allowed)-
--assisted-crawlCrawl URLs to extract SEO metadata (title, description, og tags)false
--exclude-tagsSEO tags to exclude (comma-separated: title,meta:description,og:title,canonical,lang,hreflangs)-
--crawl-contentTake the rendered page wherever the stored body is not the page: served empty, or a page builder's scaffolding — many containers and almost no text (King Composer, WPBakery, Divi, Elementor, Bricks, Beaver Builder, Oxygen)false
--skip-empty-contentSkip posts/pages with empty content from exportfalse
--auth-userUsername for Basic Auth (prompts for password if --auth-pass not provided)-
--auth-passPassword for Basic Auth-
--auth-tokenBearer token for authentication-
--rate-limitDelay between API requests in milliseconds (prevents server rate limiting)0
--no-inventory-checkSkip reading the site's sitemap and feed after the export to report what it did not coverfalse
--frontmatter-styleForm of the structured front-matter values (meta, hreflangs): nested (YAML structure) or flat (one JSON string each, so they survive a store that holds only string lists — mddb and the like)nested
--from-sitemapRead what the site publishes when the REST API will not serve it: the feed's posts, and — where the export carries no document for them — the sitemap's addresses, fetched and written as pages. Turns itself on for a WordPress older than 4.7, which has no content API at allfalse
--limitExport at most N documents in total, newest first. The walk stops when the budget is spent, so a preview of a site does not download the site; media is limited to what those documents reference, and the summary says Posts: 5 (limited from 75)0 (no limit)
--limit-per-typeAt most N of each kind, or kind=N pairs, or both: 5, posts=5,media=10, 5,media=10. A kind is a collection name (posts, pages, media, products) or a custom type's slug. Combines with --limit, whichever is smaller-
--limit-posts, --limit-pages, --limit-media, --limit-productsShortcuts for the kinds a preview is usually shaped around. Where one names a kind --limit-per-type also names, the dedicated flag wins and the run says so0 (no limit)
--user-agentThe User-Agent to send. Bot protection matches on the default, so a browser's string is the remedy that most often works against a 403 from a wallWordPress-Export-JSON/1.0
--retriesAttempts for a request the site answers with 5xx or 429, or drops. Exponential backoff with jitter, honouring Retry-After3
--resumeResume from checkpoint if previous export was interruptedfalse
--timeoutHTTP request timeout in seconds (increase for slow servers)30
--verbose, -vEnable verbose outputfalse
--quiet, -qSuppress all output, only return exit codefalse
--configConfiguration file path-

Resume / checkpoint

When exporting large sites, the --resume flag enables automatic checkpoint saving. If the export is interrupted (network error, server timeout, etc.), you can resume from where it left off:

1# First export attempt (interrupted at 90%)
2wpexportjson export --url https://large-site.com --resume -f markdown
3# Error: connection timeout...
4
5# Resume from checkpoint
6wpexportjson export --url https://large-site.com --resume -f markdown
7# Resuming from checkpoint: export/large-site.com.2026-02-02/.wpexport_checkpoint.json
8# Checkpoint: posts=1500 (done=true), pages=42 (done=false)...

The checkpoint file (.wpexport_checkpoint.json) is automatically deleted on successful completion.