wpexporter

WordPress Export JSON

Go Version License Docker CI/CD Release Go Report Card

A comprehensive WordPress content export toolkit with two powerful applications:

Both tools export content to JSON or Markdown format with full media download support.

Features

wpexporter (REST API Client)

wpxmlrpc (XML-RPC Client)

Installation

From Source

git clone https://github.com/tradik/wpexporter.git
cd wpexporter
make build

Using Go Install

go install github.com/tradik/wpexporter/cmd/wpexporter@latest

Using Docker

Docker images are available from GitHub Container Registry:

# Pull the latest image
docker pull ghcr.io/tradik/wpexporter:latest

# Run wpexporter
docker run --rm -v $(pwd)/export:/export ghcr.io/tradik/wpexporter:latest \
  wpexportjson export --url https://example.com --output /export

# Run wpxmlrpc
docker run --rm -v $(pwd)/export:/export ghcr.io/tradik/wpexporter:latest \
  wpxmlrpc export --url https://example.com --username admin --password mypassword --output /export

Quick Start

REST API Export (wpexporter)

# Export all content from a WordPress site
wpexportjson export --url https://example.com --output ./export

# Export with brute force discovery
wpexportjson export --url https://example.com --brute-force --output ./export

# Export to specific format
wpexportjson export --url https://example.com --format json --output ./export.json

# Export and create ZIP archive
wpexportjson export --url https://example.com --zip

# Export to ZIP only (remove files after creating ZIP)
wpexportjson export --url https://example.com --zip --no-files

# Export to Markdown with ZIP archive
wpexportjson export --url https://example.com -f markdown --zip

XML-RPC Export (wpxmlrpc)

# Export with authentication
wpxmlrpc export --url https://example.com --username admin --password mypassword --output ./xmlrpc-export

# Export to markdown format
wpxmlrpc export --url https://example.com --username admin --password mypassword --format markdown --output ./markdown-export

Usage

Basic Export

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

Advanced Options

wpexportjson export \
  --url https://your-wordpress-site.com \
  --format markdown \
  --output ./my-export \
  --brute-force \
  --max-id 10000 \
  --download-media \
  --concurrent 10

Configuration File

Create a config.yaml file:

url: "https://your-wordpress-site.com"
output: "./export"
format: "json"
brute_force: true
max_id: 10000
download_media: true
concurrent: 10

Then run:

wpexportjson export --config config.yaml

Command Line Options

Option Description Default
--url WordPress site URL Required
--output Output directory or file ./export
--format Export format (json/markdown) json
--brute-force Enable brute force ID discovery false
--max-id Maximum ID for brute force 10000
--download-media Download images and videos true
--concurrent Concurrent downloads 5
--zip Create ZIP archive of export false
--no-files Remove export files after creating ZIP (requires –zip) false
--config Configuration file path -

Development

Prerequisites

Setup

# Clone the repository
git clone https://github.com/tradik/wpexporter.git
cd wpexporter

# Install dependencies
make deps

# Install development tools
make dev-install

# Run in development mode
make dev

Building

# Build for current platform
make build

# Build release binaries for all platforms
make release

Testing

# Run tests
make test

# Run linter
make lint

# Format code
make format

Project Structure

wpexporter/
├── cmd/
│   └── wpexporter/        # CLI application entry point
├── internal/
│   ├── api/                 # WordPress API client
│   ├── export/              # Export functionality
│   ├── media/               # Media download handling
│   └── config/              # Configuration management
├── pkg/
│   └── models/              # Data models
├── Makefile                 # Build automation
├── go.mod                   # Go module definition
└── README.md               # This file

Architecture

graph TB
    A[CLI Interface] --> B[Configuration Manager]
    B --> C[WordPress API Client]
    C --> D[Content Discovery]
    D --> E[Brute Force Scanner]
    D --> F[Media Downloader]
    E --> G[Export Engine]
    F --> G
    G --> H[JSON Exporter]
    G --> I[Markdown Exporter]
    H --> J[Output Files]
    I --> J

Contributing

  1. Fork the repository
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add some amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

License

This project is dual-licensed under the MIT License and BSD 3-Clause License. See the LICENSE file for full license texts and choose the one that best fits your use case.

Changelog

See CHANGELOG.md for a list of changes and version history.