# WordPress Content Scraper (`fanndev/wordpress-content-scraper`) Actor

Scrapes any self-hosted WordPress site via its public REST API — posts, pages, media, categories, tags, comments, users, even custom post types. No login. Raw JSON passthrough, honest pagination, and a clear error row for sites that disable their REST API.

- **URL**: https://apify.com/fanndev/wordpress-content-scraper.md
- **Developed by:** [Faisal Ahdan naufal](https://apify.com/fanndev) (community)
- **Categories:** News
- **Features:** Limited permissions
- **Stats:** 2 total users, 1 monthly users, 100.0% runs succeeded, 0 bookmarks
- **User rating**: No ratings yet

## Pricing

from $2.10 / 1,000 results

This Actor is paid per event and usage. You are charged both the fixed price for specific events and for Apify platform usage.
Since this Actor supports Apify Store discounts, the price gets lower the higher subscription plan you have.

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 Site Content Scraper (REST API)

Export content from any self-hosted WordPress site through its public REST API: posts, pages, media, categories, tags, comments, authors and custom post types like WooCommerce products — no login, raw WordPress JSON.

### Best for

- Content migrations and backups
- Building datasets from blogs for AI or analysis
- Competitor content audits

### Example input

```json
{
  "startUrls": [
    "https://wptavern.com"
  ]
}
```

### What each row contains

| Group | Fields |
|---|---|
| Content | id, date, slug, link, title, content, excerpt, author, categories, tags |
| Media & taxonomy | media_type, source_url, name, description, count |
| Summary per site and type | totalMatches, totalPages, returnedCount |

### Good to know

- Give the site's base URL, e.g. `example.com` or `example.com/blog`.
- Pick several content types in one run; add custom post type slugs for plugin content.
- Filter by search text and published date range; turn on embedding to inline author and featured image.
- Sites that disabled their REST API get a clear ERROR row instead of silently returning nothing.

### FAQ

**Does it work on WordPress.com sites?**\
It targets self-hosted WordPress with the standard /wp-json/ API enabled.

### Support

Found a problem or need a field that is missing? Open an issue on the actor's Issues tab and include the run ID.

# Actor input Schema

## `startUrls` (type: `array`):

Base URL of each self-hosted WordPress site to scrape, e.g. `https://example.com` or `example.com/blog`. Every site is queried through its own public `/wp-json/wp/v2/` REST API -- the same one WordPress core exposes by default, with no login. A site that has disabled its REST API, or is not WordPress at all, gets a single ERROR row explaining why rather than stopping the whole run.

## `resources` (type: `array`):

Which built-in WordPress collections to pull from each site, in the SAME run -- these are independent resources sharing one client, not exclusive modes, so picking several is normal (e.g. posts + categories + tags together). Each gets its own SEARCH_SUMMARY row per site.

## `customPostTypes` (type: `array`):

Extra REST base slugs for non-core content this site's theme/plugins registered with `show_in_rest` (e.g. a WooCommerce `product`, a portfolio `project`). Fetched exactly like the built-in resources above, under a `CUSTOM_<SLUG>` record type. A slug that is not actually registered on the site fails with a clear `not_found` ERROR row for just that resource, not the whole site -- check the site's `/wp-json/` route index first if unsure.

## `search` (type: `string`):

Full-text search applied to every selected resource on every site, using WordPress's own `search` parameter. Leave empty to fetch each resource's full listing (newest first) instead.

## `after` (type: `string`):

ISO 8601 datetime, e.g. `2026-01-01T00:00:00`. Only applies to date-bearing resources (posts, pages, media, comments, custom post types) -- silently skipped for categories/tags/users, which have no date field. Leave empty for no lower bound.

## `before` (type: `string`):

ISO 8601 datetime. Same scope as 'Published after'. Leave empty for no upper bound.

## `embed` (type: `boolean`):

Adds WordPress's own `_embed=true` flag, which inlines the author, featured image and taxonomy terms directly into each post/page/media/comment row under `_embedded` -- avoiding a separate request per related object. On by default; turn off only to shrink payload size.

## `perPage` (type: `integer`):

WordPress's own `per_page` parameter. Hard-capped at 100 by the API -- any higher value fails that resource's fetch with a 400.

## `maxItemsPerResource` (type: `integer`):

Stop paging one resource on one site after this many items. Set to 0 for unlimited (walks every page WordPress reports via X-WP-TotalPages). With multiple sites/resources selected, this cap applies separately to each pair.

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

Upper bound on requests in flight at once, across every site and resource this run touches.

## `minRequestInterval` (type: `number`):

Pacing floor applied separately to each site (not shared globally across different sites), independent of 'Max concurrent requests'. No rate-limit or WAF gate was observed on any site tested, but inputs here are arbitrary user-supplied installs -- some may be small blogs on modest shared hosting, unlike this portfolio's usual large fixed targets. Set to 0 to disable.

## `proxyConfiguration` (type: `object`):

The WordPress REST API is public by design and no bot-mitigation gate was observed on any site tested, including ones behind Cloudflare. Apify's automatic proxy is the cloud default; residential is not forced since this actor targets arbitrary sites worldwide rather than one region.

## Actor input object example

```json
{
  "startUrls": [
    "https://wptavern.com"
  ],
  "resources": [
    "posts"
  ],
  "customPostTypes": [],
  "search": "",
  "after": "",
  "before": "",
  "embed": true,
  "perPage": 100,
  "maxItemsPerResource": 200,
  "maxConcurrency": 5,
  "minRequestInterval": 0.5,
  "proxyConfiguration": {
    "useApifyProxy": true
  }
}
```

# Actor output Schema

## `items` (type: `string`):

One row per scraped record. See the dataset's default view for field definitions.

# 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 = {
    "startUrls": [
        "https://wptavern.com"
    ]
};

// Run the Actor and wait for it to finish
const run = await client.actor("fanndev/wordpress-content-scraper").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 = { "startUrls": ["https://wptavern.com"] }

# Run the Actor and wait for it to finish
run = client.actor("fanndev/wordpress-content-scraper").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 '{
  "startUrls": [
    "https://wptavern.com"
  ]
}' |
apify call fanndev/wordpress-content-scraper --silent --output-dataset

```

## MCP server setup

```json
{
    "mcpServers": {
        "apify": {
            "type": "http",
            "url": "https://mcp.apify.com/?tools=fetch-actor-details,fanndev/wordpress-content-scraper"
        }
    }
}
```

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/7vgqo1p6AWRtDOvxu/builds/lRwNC796WAYxjAc78/openapi.json
