Skip to content

WordPress API

The wordpress_api scraper is part of auto_source. When a WordPress site exposes its public REST API, html2rss can read posts from that API instead of scraping article HTML.

This usually gives cleaner results because WordPress already exposes fields such as the title, content, excerpt, permalink, publish date, and category IDs.

Enable auto_source as usual:

channel:
url: "https://example.com/blog"
auto_source: {}

If the target is a standard WordPress site with a public API, no selectors are required.

The scraper works when the page exposes the standard WordPress API link in its <head>:

<link rel="https://api.w.org/" href="https://example.com/wp-json/" />

If that link is missing or the API is blocked, auto_source falls back to its other discovery strategies.

You can disable wordpress_api while keeping the rest of auto_source enabled:

channel:
url: "https://example.com/blog"
auto_source:
scraper:
wordpress_api:
enabled: false

The scraper maps the WordPress response into html2rss article fields like this:

WordPress fieldhtml2rss article field
idid
title.renderedtitle
content.rendereddescription
linkurl
datepublished_at
categoriescategories

If content.rendered is blank, the scraper falls back to excerpt.rendered.

  • Categories stay as WordPress category IDs. Category names are not resolved yet.
  • Featured images are not pulled from featured_media yet.