WordPress Scraper: Posts, Pages & Metadata From Any WP Site
A wordpress scraper guide with no plugin install: REST API, feeds, sitemaps and page HTML on any WordPress site, live-tested with real outputs.

On this page
WordPress is the one target where scraping tutorials solve a solved problem. Every WordPress site since core 4.7 ships a JSON REST API that hands over every post, page, author, category and tag, keyless and paginated, with full HTML bodies. On 2026-10-30 I ran a wordpress scraper against three live WordPress sites (wordpress.org/news, TechCrunch, yoast.com) and pulled a 1,114-post inventory from the first one without installing a plugin, logging in, or rendering a single page.
All commands below ran with Magpie, a local CLI scraper (free, AGPL-3.0-or-later/commercial dual license). Static fetch handled everything; the browser renderer stayed off the entire session.
The four doors, and what robots.txt says about them
The User-agent: * groups of wordpress.org/robots.txt disallow exactly four patterns: /wp-admin/ (with three admin-asset exceptions), /search, /?s= and /plugins/search/. No Crawl-delay. Nine AI crawlers from GPTBot to Copilot get an explicit Allow: /, which is as close to a written invitation as robots.txt gets. Everything you might want to scrape is allowed by absence.
That leaves four doors into any WordPress site:
| Door | URL | Status on wordpress.org/news | What it gives you |
|---|---|---|---|
| REST API | /wp-json/wp/v2/posts |
Keyless 200 | Every post: full body, dates, author, categories, tags, featured image |
| RSS feed | /feed/ |
Keyless 200 | Latest 10 posts, full bodies, author names, server-side ?paged= |
| Sitemap | /news/sitemap.xml |
Keyless 200 | URL inventory back to 2003 |
| Page HTML | /news/{slug}/ |
Keyless 200 | Clean article text; most metadata stripped by the cleaner |
Work them in that order. The API answers the questions the other three can’t.
The REST API is the scraper
One call returns a page of posts with machine-readable counts in the headers:
$ curl -sI "https://wordpress.org/news/wp-json/wp/v2/posts?per_page=2&_fields=id" \
| grep -i x-wp
x-wp-total: 1114
x-wp-totalpages: 557
Total inventory, no counting. Each response also carries a Link header with rel="prev" and rel="next" URLs, so the pagination loop writes itself: start at page 1, follow next until it disappears. per_page caps at 100; ask for 101 and the API refuses with its own explanation: per_page must be between 1 (inclusive) and 100 (exclusive).
A full post record carries 28 keys. The ones worth knowing:
content.rendered: the complete post HTML, not a summarytitle.rendered,excerpt.rendered: both with HTML wrappers you’ll stripdate,date_gmt,modified,modified_gmt: publish and update times to the secondslug,link,guid: three forms of the same identityauthor,categories,tags: integer IDs that resolve through sibling endpoints (next section)jetpack_featured_media_url: the featured image URL, directly (Jetpack adds it)format,sticky,comment_status,ping_status: publishing state
Use _fields= to trim payloads; the API accepts a comma list and drops everything else. The excerpt alone weighs a few hundred bytes, which matters when you’re paging through 557 pages.
The IDs are not dead ends. ?categories=3 filters posts by category (Community on this site, 113 posts), ?tags= accepts multiple IDs, and /wp/v2/tags?include=360,359 resolves a batch of tag IDs to names in one call. The author join is the satisfying one:
$ curl -s "https://wordpress.org/news/wp-json/wp/v2/users/2738372?_fields=name,slug,url"
{"id":2738372,"name":"Aaron Jorbin","url":"https:\/\/aaron.jorb.in","slug":"jorbin"}
The users endpoint is public on this site; on TechCrunch the same join 404’d (Invalid user ID for its author integers), so there your author names come from the feed’s dc:creator, which ships them inline. There is also /wp/v2/search?search=security, a keyless site search that returns title and URL pairs, and /wp/v2/pages for static pages (this site exposes two, “News” and “All Posts”).
Two limits, stated plainly. Fields marked context=edit need authentication: ?context=edit answers 401 rest_forbidden_context (“Sorry, you are not allowed to edit this post”), and that’s correct behavior, not a bug. And one Magpie-specific quirk: when you point magpie scrape at a JSON endpoint, the output comes back wrapped in Magpie’s own HTML viewer (<pre>{...}</pre> plus a json-formatter-container div). The same URL through curl returns bare JSON. For API calls, either use curl and jq, or strip the <pre> wrapper after fetching. Magpie earns its keep on the other three doors.
Feeds: ten posts at a time, and they paginate
/feed/ returns the 10 newest posts with dc:creator author names and, on this site, full content:encoded bodies. The pagination nobody mentions: WordPress feeds take ?paged=2, and page two held 10 fresh items with zero overlap.
Magpie’s rss vertical parses it typed:
$ magpie scrape "https://wordpress.org/news/feed/" --vertical rss
{
"title": "WordPress News",
"record": {
"items": [
{"link": ".../2026/10/wordpress-7-1-4/",
"published": "Wed, 28 Oct 2026 17:13:02 +0000",
"summary": "This security release features fixes..."}
Abridged. The vertical keeps title, link, pubDate and summary per item; the full content:encoded bodies stay in the raw XML, so grab those with --page-format raw when you need them. Ten items per page makes the feed a sampling tool; the API is the bulk tool.
Sitemaps: three flavors, and map walks them
WordPress ships three sitemap conventions, and which one a site uses tells you what else to expect:
- Core (WP 5.5+):
/wp-sitemap.xml. Shipped in core since 2019, so it’s the default on self-hosted installs. On this one it’s a 404, because Jetpack replaced it. - Jetpack:
/sitemap.xmlas a nested index. Here it chains throughsitemap-index-1.xmldown to two leaf files of 1,000 URLs each, reaching back to April 2003. - Yoast: also
/sitemap.xml, with per-type children (post-sitemap.xml,page-sitemap.xml). TechCrunch’s/wp-sitemap.xml301s straight to it.
Magpie’s map command reads declared sitemaps and returns the URL inventory:
$ magpie map "https://wordpress.org/news/"
# 10,000 URLs (the cap), from the site-wide wordpress.org index:
# /plugins/widget-importer-exporter/
# /plugins/mailchimp/
# ...
Because wordpress.org declares nine sitemaps in robots.txt, map walked the whole multi-section site and came back with plugin, theme, showcase and news URLs mixed. On a normal single-site install you get just that site’s posts. Cap to know: 10,000 URLs per map run.
Page HTML: what the cleaner keeps and what it drops
Post pages fetch clean statically. The WordPress 7.1.4 announcement came back as 512 words of Markdown with every inline link and the bold lede intact. What the cleaner drops: the H1, the byline, the date. If your pipeline needs per-post metadata, don’t rebuild it from HTML; the API already has it.
The homepage is a different story. It cleans to 230 words of flattened navigation: menu soup up top, then the latest posts with categories and dates inlined (WordPress 7.1.4 Releases , Security October 28, 2026), then a people-listing block. Usable as a change detector, useless as an inventory.
Category archives are the hard failure. /news/category/community/ trips Magpie’s quality gate:
Error: quality blocked (empty) for https://wordpress.org/news/category/community/
Exit 8, no output. The theme renders these archives as thin shells, so use the API’s ?categories= filter instead; same data, better shape. Homepage pagination (/news/page/2/) still answers 200 if you want the human-facing view.
One expectation to kill: structured data. I checked the JSON-LD on all three test sites and found zero Article markup on any of them. wordpress.org/news ships none at all; TechCrunch embeds a rich WebPage/WebSite/Breadcrumb graph with no Article node; yoast.com, the SEO plugin company, does the same. That means Magpie’s article vertical correctly refuses these pages with a typed error (no Article data at https://wordpress.org/news/2026/10/wordpress-7-1-4/). WordPress sites today expose their structure through the REST API, not through schema.org. og:title, og:image and friends do survive in --page-format raw HTML if you need the social-card metadata; note that wp.org/news sets a site-wide default og:image rather than per-post artwork.
Where each metadata field actually lives
The title promised metadata, so here is the map. First choice, fallback:
| Field | Primary source | Fallback |
|---|---|---|
| Post title | title.rendered (API) |
<title> element, og:title |
| Publish/update dates | date_gmt / modified_gmt (API) |
feed pubDate; nothing in cleaned HTML |
| Full body | content.rendered (API) |
content:encoded (feed); cleaned Markdown (HTML) |
| Excerpt | excerpt.rendered (API) |
feed description |
| Author | author ID + /users/{id} join |
feed dc:creator (name inline) |
| Categories, tags | categories / tags IDs (API) |
/wp/v2/categories, /wp/v2/tags |
| Featured image | jetpack_featured_media_url (API) |
og:image in raw HTML |
| SEO/social fields | yoast_head_json (API, Yoast sites) |
og:* meta in raw HTML |
| URL identity | slug + link + guid (API) |
sitemap <loc> |
Nothing on this table requires a plugin, a login, or a browser. The cleaned HTML is the only source missing almost everything.
What changes on other WordPress sites
Three sites is a small sample, so here is what varied and what didn’t. The API worked keyless on all three self-hosted installs: TechCrunch reports x-wp-total: 263078 and embeds a full yoast_head_json block (og fields, schema graph, robots directives) in every record; yoast.com answered the same endpoint shape. What did not vary is the point: /wp-json/wp/v2/posts is part of core, so it is present, shaped identically, and paginated the same way everywhere it’s allowed.
Where it goes wrong, predictably:
- Security plugins can kill it. “Disable REST API”-type plugins block
/wp-jsonwholesale or whitelist only logged-in requests. The tell is a 401 or 403 on the posts endpoint while the site renders fine. Probe/wp-json(the root index) before writing any code: this site’s root advertises 554 routes. - WordPress.com is a different animal. Hosted sites serve their API from
public-api.wordpress.com/wp/v2/sites/{site}/posts, not from the site’s own domain. The one I tested (wordpress.com/blog) answered403 unauthorized: User cannot access this restricted blog. Treat wp.com as out of scope for the keyless recipe; self-hosted is where this guide applies. - Custom post types (products, portfolios, podcasts) appear as extra routes on the root
/wp-jsonindex. One request tells you their REST bases; then/wp-json/wp/v2/{type}works exactly like posts. The/wp/v2/typesendpoint itself came back empty on this site, so trust the root index over it.
Running the WordPress scraper on all four doors
The shape I’d actually run: API for records, sitemap for URL inventory, feed for change detection, Magpie for readable page text.
# 1. Records: page through the API, 100 at a time, follow Link headers
page=1
while :; do
curl -s "https://example.com/wp-json/wp/v2/posts?per_page=100&page=$page&_fields=id,slug,date,link,title,content" \
> posts-$page.json
[ "$(jq length posts-$page.json)" -eq 0 ] && break
page=$((page+1)); sleep 3
done
# 2. URL inventory and readable text via Magpie
magpie map "https://example.com/" > urls.txt
magpie scrape "https://example.com/feed/" --vertical rss > feed.json
magpie scrape "https://example.com/some-post/" > post.md
On politeness: Magpie’s single scrape calls are unthrottled, so the sleep 3 in that loop is the throttle. I made about 45 requests across three sites at 2-3 second spacing and never saw a challenge or a rate limit. WordPress infrastructure is used to bots; the robots file says yes.
Dead ends, stated plainly
- Category archives fail the quality gate (
quality blocked (empty), exit 8). API filter instead. - The
articlevertical refuses every tested WordPress page: zero Article JSON-LD on all three sites. Use the API record or the sidecar-less Markdown. - JSON endpoints through
magpie scrapereturn Magpie’s HTML viewer wrapper, not bare JSON. curl or strip the<pre>. context=editfields need authentication (401). The public record is already rich; don’t chase edit context.wp-sitemap.xml404s under Jetpack (replaced by/sitemap.xml) and 301s under Yoast. Follow what’s there.- WordPress.com-hosted blogs are out of scope: the public API host answered 403 on my test.
- I tested from one residential connection at low volume. Sites running security plugins with IP-based rules will behave differently, and I did not test any of them at scale.
Same platform family, other guides: Medium and Substack for two publishing platforms that do NOT hand you a REST API, and the scrapers for popular websites hub for the full list.
FAQ
Is scraping a WordPress site legal? Scraping public pages and public APIs is generally lawful, but it is site-specific. WordPress’s own robots.txt allows everything except admin and search paths. Read the target site’s terms before bulk or commercial use, and see the legal explainer.
Does WordPress have a built-in API?
Yes. The JSON REST API has shipped in core since 4.7 (2016), at /wp-json/wp/v2/posts for posts, with sibling endpoints for pages, media, users, categories and tags. No plugin, no key.
How do I scrape all posts from a WordPress site?
GET /wp-json/wp/v2/posts?per_page=100&page=N in a loop until an empty array, reading x-wp-total for the count up front. 100 per page is the hard cap; x-wp-totalpages tells you the last page number before you start.
Why is /wp-json empty or blocked on some sites I try?
Security plugins like Disable REST API block it, some hosts filter it, and WordPress.com sites serve their API from a different host entirely. Probe /wp-json first; a 401 or 403 there means the keyless recipe does not apply to that site.
Do I get full post content or just excerpts from the API?
Both, keyless: content.rendered carries the complete HTML body and excerpt.rendered the summary, in the same record. The RSS feed matches, with full content:encoded bodies on most sites and a 10-item page size.


