# WordPress REST API Scraper: Export Posts & Pages to Markdown (`atesen-software/wordpress-posts-pages-exporter`) Actor

WordPress REST API scraper and export tool. Get posts and pages as JSON, HTML and Markdown with title, URL, dates, author, categories, tags and images. For site migration, backup and content audits. Needs a public REST API. No login, no proxy. Pay per result.

- **URL**: https://apify.com/atesen-software/wordpress-posts-pages-exporter.md
- **Developed by:** [Atesen Software](https://apify.com/atesen-software) (community)
- **Categories:** Developer tools, SEO tools, Automation
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

$4.00 / 1,000 exported post or pages

This Actor is paid per event. You are not charged for the Apify platform usage, but only a fixed price for specific events.

Learn more: https://docs.apify.com/actors/running/actors-in-store.md#pay-per-event

## What's an Apify Actor?

An Actor is a serverless cloud program that runs on the Apify platform. It has two run modes.
In Batch mode, an Actor accepts a well-defined JSON input, performs an action which can take anything from a few seconds to a few hours,
and optionally produces a well-defined JSON output, datasets with results, or files in key-value store.
In Standby mode, an Actor provides a web server which can be used as a website, API, or an MCP server.

Apify vocabulary and the platform model are defined once, in the agent quickstart at https://apify.com/agents.md.

## How to integrate an Actor?

If asked about integration, you help developers integrate Actors into their projects.
You adapt to their stack and deliver integrations that are safe, well-documented, and production-ready.

Do not guess an integration path. Every one of them is in the agent quickstart at https://apify.com/agents.md: the Apify MCP server, Agent Skills with the Apify CLI, the JavaScript and Python clients, the REST API, and the account-free path for an agent with no human to sign in. It also carries the rule on stating cost before the first paid run.

For examples already wired to this Actor's own input schema, see the [API](#api) section below.

Each client library has reference documentation the quickstart does not restate: [JavaScript/TypeScript](https://docs.apify.com/api/client/js/docs.md) (`npm install apify-client`) and [Python](https://docs.apify.com/api/client/python/docs.md) (`pip install apify-client`).

# README

WordPress REST API scraper and export tool: get the posts and pages of a WordPress site as JSON, HTML and Markdown, with categories, tags, authors and images. No login needed.

### WordPress REST API Scraper: Export Posts & Pages to Markdown

Give it one or more WordPress sites and get every **post and page** as clean rows: **title, slug, URL, publish and modified dates, author name, category and tag names, plain-text excerpt, full content as HTML and as Markdown, featured image URL and word count**. It reads the same public JSON endpoints that WordPress itself publishes under `/wp-json/wp/v2/`, so no API key, no browser and no proxy are needed.

**It needs the public REST API.** Sites that switched it off, protect it with a login or firewall, or forbid `/wp-json/` in `robots.txt` cannot be exported; for those you get one free status row that says why.

- **Two content formats**: `contentHtml` for exact reproduction, `contentMarkdown` ready for static-site generators, notes tools and language-model pipelines.
- **Filters**: content types (posts, pages), date range, categories and tags (slugs or IDs), and a maximum number of items per site.
- **Several sites per run**: each site is read at about one request per second and its `robots.txt` is respected.
- **Never crashes on a closed site**: when the REST API is switched off, blocked or missing, you get one free `status` row that says why (HTTP 401/403/404, an HTML page instead of JSON, or a `robots.txt` rule).
- **Email addresses are removed** from author names, excerpts and exported article text. Other personal data in published content may remain.

### Use cases

- **WordPress export and site migration**: turn WordPress posts into Markdown (WP posts to Markdown) and move a blog or a documentation site to another CMS or a static site generator, with title, slug, dates, categories and tags as front-matter data.
- **Content audit and SEO**: list every URL with title, excerpt, word count, categories, tags and last-modified date to find thin, outdated or untagged content.
- **LLM datasets**: build clean text corpora, retrieval (RAG) knowledge bases and fine-tuning sets from sites you are allowed to use, with Markdown that keeps headings, lists and links.
- **Backup and archive**: keep a dated copy of everything a WordPress site published, as JSON, CSV or Excel from the dataset.

### Input

| Field | Description |
|---|---|
| `sites` | WordPress domains or URLs, for example `wptavern.com` or `https://example.com/blog` (sub-directory installs work). |
| `postTypes` | `posts`, `pages` or both. Default both; posts come first. |
| `maxItemsPerSite` | Posts and pages together, posts first, newest first within each type. Default 100: a site with 100 or more posts returns no pages unless you raise this or choose only "pages". `0` = the whole site. |
| `dateFrom`, `dateTo` | Optional publish date range (`YYYY-MM-DD`, site time zone, both ends included). |
| `categories`, `tags` | Optional slugs or numeric IDs. Only posts are filtered; when set, pages are left out. |
| `includeContent` | Default on. Turn off for a light list without `contentHtml`, `contentMarkdown` and `wordCount`. |
| `includeSiteInfo` | Default on. One free `site` row per site. |
| `maxConcurrency` | Sites read in parallel (default 2). Each single site still gets about one request per second. |

```json
{
  "sites": ["wordpress.org/news", "wptavern.com", "https://developer.wordpress.org/news/"],
  "maxItemsPerSite": 20
}
```

### Output

One row per post or page. Long text is shortened with "…" in this example.

```json
{
  "type": "post",
  "site": "developer.wordpress.org/news",
  "id": 6415,
  "title": "What’s new for developers? (October 2026)",
  "slug": "whats-new-for-developers-october-2026",
  "url": "https://developer.wordpress.org/news/2026/10/whats-new-for-developers-october-2026/",
  "date": "2026-10-14T19:56:09Z",
  "modified": "2026-10-14T19:56:25Z",
  "author": "Justin Tadlock",
  "categories": ["Blocks", "Playground", "Plugins", "Themes"],
  "tags": ["Monthly Roundups"],
  "excerpt": "Your October guide to WordPress development: the 7.2 roadmap, the Ipsum theme, new block APIs, and what to test before Beta 1.",
  "contentHtml": "\n<p class=\"wp-block-paragraph\">This edition is running a bit late. I was sick last week, …",
  "contentMarkdown": "This edition is running a bit late. I was sick last week, and it seems that sorting through two Gutenberg releases and a…",
  "wordCount": 2328,
  "featuredImageUrl": "https://developer.wordpress.org/news/files/2026/10/whats-new-devs-oct-2026.png",
  "input": "https://developer.wordpress.org/news/",
  "scrapedAt": "2026-10-23T20:41:35.482Z"
}
```

`type` is `post` or `page`. Pages have no `categories` and `tags`. Dates are UTC. `wordCount` counts words of the plain text of the body.

Free helper rows share the same dataset:

- `type: "site"`: `site`, `name`, `description`, `homeUrl`, `timezone`, `restApi`, `postsMatching`, `pagesMatching`, `itemsSaved`, `complete` (false when an item/budget limit or a later-page failure stopped the export; partial rows remain counted in `itemsSaved`), `authorNamesAvailable`.
- `type: "status"`: `status`, `input`, `httpStatus`, `message`.

Status values you may see: `rest_api_disabled` (HTTP 401/403), `rest_api_not_found` (HTTP 404 or an HTML page instead of JSON), `blocked_by_robots`, `fetch_failed`, `category_not_found`, `tag_not_found`, `empty`, `invalid_url`, `invalid_input`.

```json
{
  "type": "status",
  "status": "rest_api_disabled",
  "input": "css-tricks.com",
  "message": "The REST API answered HTTP 401: it is disabled or blocked for public visitors. Not charged.",
  "site": "css-tricks.com",
  "httpStatus": 401,
  "scrapedAt": "2026-10-23T20:44:03.042Z"
}
```

### Limits

- Only public HTTP(S) sites without URL credentials are supported. Local/private/reserved IP addresses and mixed public/private DNS answers are rejected; each connection is pinned to a vetted public address. Redirects (up to five) and advertised REST roots follow the same checks, and each content hop must pass its target site's robots rules. Responses larger than 8 MiB (512 KiB for robots.txt) are stopped and reported as free failure rows. Earlier saved post/page rows remain counted results and partial site summaries say `complete: false`; exporting every site regardless of response size is not guaranteed.
- The site's public REST API must be on. Sites that disable or protect it, or that forbid `/wp-json/` in `robots.txt`, return a status row only.
- Only published, public posts and pages are exported. No drafts, no private or password-protected bodies, no custom post types, no comments.
- If a site hides its users endpoint, `author` is empty (the site row shows `authorNamesAvailable: false`).
- Date filters use the site's own time zone, as WordPress does.
- Email addresses are removed from exported excerpts and article text. Other personal data in published content may remain.

### FAQ

**Does it work with every WordPress site?** It works with every site that leaves the standard REST API (`/wp-json/wp/v2/`) open, which is the default for WordPress. Sites using security plugins, firewalls or a headless setup may close it. In that case the run still succeeds and you get one free status row per site that tells you the reason.

**How fast is it, and is it polite to the site?** About one request per second per site, with retries and back-off on errors, and the site's `robots.txt` is read first and obeyed. For example, a site that disallows `/wp-json/` for all crawlers is skipped with a `blocked_by_robots` row instead of being fetched.

**Does it collect personal data?** Author e-mail addresses are removed, as are e-mail addresses in excerpts and article text. Other personal data in published content may remain; please check the site's terms and the laws that apply to you before you reuse its articles.

**How do I export only part of a site?** Set `dateFrom` and `dateTo`, list category or tag slugs, choose `posts` or `pages`, and cap the size with `maxItemsPerSite`. The `site` row tells you how many items matched and whether your limit cut the export short.

**Why is `featuredImageUrl` empty for some posts?** The post has no featured image, or the site hides its media endpoint.

### Pricing

Pay per result — see the Pricing tab.

Each saved post or page row is one result. Status rows and site info rows are free. The run stops when it reaches the maximum cost per run that you set, including across concurrently processed sites. With no remaining result budget it makes no requests. On graceful abort it saves `RUN_SUMMARY` and a `STATE` snapshot of saved site/type/item IDs before shutdown; snapshots do not automatically resume a later run.

### Support and disclaimers

Questions and feature requests belong on the **Issues** tab of this Actor's page on Apify. This Actor is an independent tool and is not affiliated with WordPress, Automattic or the sites it reads. It reads only what a site publishes through its public REST API; how you may use that content depends on the site's terms and the applicable law.

# Actor input Schema

## `sites` (type: `array`):

WordPress site domains or URLs ("wptavern.com", "https://example.com/blog"). Sub-directory installs work too. The site must have its public REST API (/wp-json/) switched on.

## `postTypes` (type: `array`):

Which public content types to export. Posts come first, then pages.

## `maxItemsPerSite` (type: `integer`):

Posts and pages together, posts first, newest first within each type. Default 100: a site with 100 or more posts returns no pages unless you raise this or choose only "pages". 0 = the whole site.

## `dateFrom` (type: `string`):

Optional. Only items published on or after this date (YYYY-MM-DD, site time zone).

## `dateTo` (type: `string`):

Optional. Only items published on or before this date (YYYY-MM-DD, site time zone).

## `categories` (type: `array`):

Optional. Category slugs or numeric IDs. Keeps only posts in at least one of them. When set, pages are left out because they have no categories.

## `tags` (type: `array`):

Optional. Tag slugs or numeric IDs. Keeps only posts with at least one of them. When set, pages are left out because they have no tags.

## `includeContent` (type: `boolean`):

Full body as HTML and Markdown, plus word count. Turn off for a light list of titles, dates and excerpts.

## `includeSiteInfo` (type: `boolean`):

One free row per site: name, description, REST address used, how many items matched and how many were saved.

## `maxConcurrency` (type: `integer`):

How many different sites are read at the same time. Each single site is still read at about one request per second.

## Actor input object example

```json
{
  "sites": [
    "wordpress.org/news"
  ],
  "postTypes": [
    "posts",
    "pages"
  ],
  "maxItemsPerSite": 100,
  "includeContent": true,
  "includeSiteInfo": true,
  "maxConcurrency": 2
}
```

# Actor output Schema

## `content` (type: `string`):

No description

## `allFields` (type: `string`):

No description

## `summary` (type: `string`):

No description

# API

You can run this Actor programmatically using our API. Below are code examples in JavaScript, Python, and CLI, as well as the OpenAPI specification and MCP server setup.

## JavaScript example

```javascript
import { ApifyClient } from 'apify-client';

// Initialize the ApifyClient with your Apify API token
// Replace the '<YOUR_API_TOKEN>' with your token
const client = new ApifyClient({
    token: '<YOUR_API_TOKEN>',
});

// Prepare Actor input
const input = {
    "sites": [
        "wordpress.org/news"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("atesen-software/wordpress-posts-pages-exporter").call(input);

// Fetch and print Actor results from the run's dataset (if any)
console.log('Results from dataset');
console.log(`💾 Check your data here: https://console.apify.com/storage/datasets/${run.defaultDatasetId}`);
const { items } = await client.dataset(run.defaultDatasetId).listItems();
items.forEach((item) => {
    console.dir(item);
});

// 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/js/docs

```

## Python example

```python
from apify_client import ApifyClient

# Initialize the ApifyClient with your Apify API token
# Replace '<YOUR_API_TOKEN>' with your token.
client = ApifyClient("<YOUR_API_TOKEN>")

# Prepare the Actor input
run_input = { "sites": ["wordpress.org/news"] }

# Run the Actor and wait for it to finish
run = client.actor("atesen-software/wordpress-posts-pages-exporter").call(run_input=run_input)

# Fetch and print Actor results from the run's dataset (if there are any)
print(f"💾 Check your data here: https://console.apify.com/storage/datasets/{run.default_dataset_id}")
for item in client.dataset(run.default_dataset_id).iterate_items():
    print(item)

# 📚 Want to learn more 📖? Go to → https://docs.apify.com/api/client/python/docs/quick-start

```

## CLI example

```bash
echo '{
  "sites": [
    "wordpress.org/news"
  ]
}' |
apify call atesen-software/wordpress-posts-pages-exporter --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,atesen-software/wordpress-posts-pages-exporter"
        }
    }
}
```

The hosted server signs you in with OAuth on first connect, so no API token belongs in this config. Clients without OAuth support can send an `Authorization: Bearer <APIFY_API_TOKEN>` header instead, using a token from API & Integrations in Apify Console (https://console.apify.com/settings/integrations).

## OpenAPI specification

Download the OpenAPI definition: https://api.apify.com/v2/actors/O2Luq49HmWsJ4sczI/builds/chJzfrQI2hPvCc6xJ/openapi.json
