wp-static-clone

Clone a dynamic WordPress (or other CMS-driven) site into a static HTML site deployable to any static host (e.g., Cloudflare Pages, Netlify, Vercel, S3+CloudFront, plain Apache/nginx). The process extracts all URLs from sitemap_index.xml, fetches all resources, rewrites paths to root-relative, removes WordPress runtime markers, and outputs a flattened directory that can be deployed without a build step—suitable for crawling, freezing, archiving, or migrating to a static host.

Last repository push
GitHub Stars
110
Forks
10
Issues / PRs
4

Installation

Review the source and dependencies with a prompt. A package is available to download.

Install with an AI assistant

Copy the prompt so your assistant can review the pinned revision and dependencies first.

View promptHide prompt
Check whether SkillPI Skill Finder is installed for your current agent. If it is missing, install and enable it using the official instructions at https://github.com/Findskills/skillpi. Then use Skill Finder to locate and install "wp-static-clone" from this exact SkillPI detail page: https://skillpi.com/skills/deepskill-aa24088034c607ce902dbbd6ba00d0b95892308ecdf4f261855324b5d3ac226a. Verify the upstream source and version against https://github.com/jdevalk/skills before installing. If they do not match, stop and report the mismatch. Report the installed path and source version.

Source and setup

github.com

Setup guidance pending

See the original source for supported tools, dependencies, and permissions.

Installation test pending

Clone a dynamic WordPress (or other CMS-driven) site into a static HTML site deployable to any static host (e.g., Cloudflare Pages, Netlify, Vercel, S3+CloudFront, plain Apache/nginx). The process extracts all URLs from sitemap_index.xml, fetches all resources, rewrites paths to root-relative, removes WordPress runtime markers, and outputs a flattened directory that can be deployed without a build step—suitable for crawling, freezing, archiving, or migrating to a static host.

0 Downloads

Introduction source: third_party · jdevalk · 0.0.1 Reference

SkillPi interpretation

Tasks
Turn a live WordPress site into a static HTML clone deployable on any static host. Driven by the site's XML sitemap. Handles the WordPress-specific gotchas — Cloudflare bot protection, mid-scrape link rewriting, proxied analytics, R2-offloaded uploads, comment-form runtime, Yoast attribution, Gravatar privacy — that a naïve `wget` run misses.
Audience
Trigger on requests like: "Scrape this WordPress site for [host]" "Freeze [domain] as static HTML" "Pull all the pages from this sitemap and turn them into static files" "Move this WP site to [host] with no build step" The broad shape (sitemap → wget → root-relative paths → static host) generalises to any CMS that emits a standard XML sitemap. The runtime cleanup (comment forms, Plausible proxy, Gravatar, Yoast) is WordPress-specific.
Inputs and outputs
So future-you (or anyone reading view-source) can tell at a glance that this is the static clone, not the live WP install: Inserts an HTML comment after `<!DOCTYPE html>` on every page. Idempotent. Then replace the "Generated by Yoast SEO" attribution in `wp-content/plugins/wordpress-seo/css/main-sitemap.xsl` — recipe in `AGENTS.md`.
Software, accounts and paid services
Not specified in the source documentation.
Limits and differences
Not specified in the source documentation.
Testing
Not tested

Browse files

Browse files at the source ↗

Original SKILL.md

Open original ↗
Frontmatter
name: wp-static-clone
description: >
  Clones a live WordPress (or other CMS-driven) site into a static HTML
  site deployable on any static host (Cloudflare Pages, Netlify, Vercel,
  S3+CloudFront, plain Apache/nginx). Use when the user wants to "scrape",
  "freeze", "archive", "static-ify", or "move to [host]" a WordPress site,
  or asks to turn a sitemap into deployable static HTML. Pulls every URL
  from sitemap_index.xml, fetches all assets, rewrites paths to be
  root-relative, strips WP runtime markup, and outputs a flat directory
  ready to deploy with no build command.

wp-static-clone

Turn a live WordPress site into a static HTML clone deployable on any static host. Driven by the site's XML sitemap. Handles the WordPress-specific gotchas — Cloudflare bot protection, mid-scrape link rewriting, proxied analytics, R2-offloaded uploads, comment-form runtime, Yoast attribution, Gravatar privacy — that a naïve wget run misses.

Recipes live in AGENTS.md; reusable scripts in scripts/. This file is the workflow, gotchas, and output structure.

When to use

Trigger on requests like:

  • "Scrape this WordPress site for [host]"
  • "Freeze [domain] as static HTML"
  • "Pull all the pages from this sitemap and turn them into static files"
  • "Move this WP site to [host] with no build step"

The broad shape (sitemap → wget → root-relative paths → static host) generalises to any CMS that emits a standard XML sitemap. The runtime cleanup (comment forms, Plausible proxy, Gravatar, Yoast) is WordPress-specific.

Workflow

Phase 0 — Confirm intent

Before scraping, confirm:

  • Source URL (the live site).
  • Target host — Cloudflare Pages, Netlify, Vercel, generic static. Drives Phase 9.
  • Same or different domain at the destination. Drives whether og:url, <link rel="canonical">, and JSON-LD @id stay absolute (same domain — correct SEO behaviour) or get rewritten (different domain).
  • What to do with analytics and forms. WP plugins for both can't run statically. Plausible gets replaced with the standard tracker (recipe in AGENTS.md); contact/search forms either get removed or wired through Pages Functions / Formspree / Netlify Forms — host-specific.

Phase 1 — Discover URLs and pull XML sitemaps

Fetch the sitemap index. Try <root>/sitemap_index.xml (Yoast convention) first, then <root>/sitemap.xml. If the index references sub-sitemaps (page-sitemap.xml, post-sitemap.xml, …), fetch each and concatenate <loc> values into urls.txt. Skip image-sitemap entries.

Also fetch the XML sitemaps themselves and the Yoast XSL stylesheet now (recipe in AGENTS.md) — they aren't linked from HTML, so wget -p won't find them later.

Phase 2 — Scrape in one shot

Critical: scrape every URL in a single wget invocation so its --convert-links pass sees all downloaded files and rewrites cross-page links correctly. Scraping URLs in separate runs leaves residual absolute links on whichever page was scraped first/last. Recipe in AGENTS.md.

Phase 3 — Pull assets the page-requisites pass missed

Some assets aren't -p-followed because they appear only in og:image, apple-touch-icon, JSON-LD image/logo, msapplication-TileImage, or <link rel="modulepreload">. Audit and fetch the long tail. Recipe in AGENTS.md covers all three asset roots (uploads, themes, plugins).

Phase 4 — Convert paths to root-relative

wget -k produces a mix of ../wp-content/... (depth-relative) and bare wp-content/... (homepage). Both work locally but break the moment a page moves. Convert to root-relative /wp-content/... everywhere:

python3 scripts/rewrite-paths.py output/ urls.txt --source-domain example.com

The script derives the page-slug list from urls.txt, not from a directory walk — otherwise wget-grabbed archive directories like category/, feed/, author/, wp-json/ get wrongly classified as pages and their inter-page links get mis-rewritten.

The script defaults to WordPress asset roots (wp-content, wp-includes). For non-WP sources, override with --asset-roots: e.g. --asset-roots sites/default/files,sites/default/themes for Drupal, --asset-roots content/images for Ghost. The rest of the rewriter is CMS-agnostic.

Phase 5 — Brand the static output

So future-you (or anyone reading view-source) can tell at a glance that this is the static clone, not the live WP install:

python3 scripts/insert-banner.py output/

Inserts an HTML comment after <!DOCTYPE html> on every page. Idempotent. Then replace the "Generated by Yoast SEO" attribution in wp-content/plugins/wordpress-seo/css/main-sitemap.xsl — recipe in AGENTS.md.

Phase 6 — Replace WP runtime hooks

Three categories of WP-only markup that breaks once the backend is gone:

1. Comment forms, reply links, and dead head tags. One pass:

python3 scripts/strip-wp-runtime.py output/

Removes <div id="respond"> blocks (the comment form), comment-reply-link anchors in both block-theme and classic-theme variants, the comment-reply-js script tag and its underlying file, and dead <head> tags (REST API discovery, RSD, oEmbed alternates, RSS alternates, archive next links). Match-by-class throughout — no language assumptions about link text.

2. Plausible analytics proxy. The WP plugin proxies the script through /wp-content/uploads/<hash>/pa-XXX.js and posts events back to /wp-json/.... Both endpoints disappear. Replace the two-script block with the standard tracker — recipe in AGENTS.md.

3. Gravatar avatars. Self-host every distinct (hash, size) pair, drop the ?s=N&d=mm requests to a third party:

python3 scripts/selfhost-gravatars.py output/

Saves under avatars/ and rewrites every reference. Detects extension from response bytes (PNG fallback vs JPEG real avatar), keeps size variants separate (?s=40 and ?s=80 are different files).

After the scripts, audit remaining absolute source-domain URLs (recipe in AGENTS.md) and triage by case: author archives → strip the <a> wrapper, server-rendered iframes → drop the wrapping <p>, Gravity Forms script blocks → strip on gform-mention, etc.

Phase 7 — Copy robots.txt

Not linked from HTML; fetch it explicitly. Adjust the Sitemap: reference if the deployed sitemap path differs from the source.

Phase 8 — Verify locally

Serve from output/ with python3 -m http.server, then run the verify checklist in AGENTS.md:

  1. Every URL in urls.txt resolves to a file (no missed pages).
  2. No remaining https://<source-domain>/ outside the canonical / og:url / JSON-LD allow-list.
  3. No broken internal links from wget --spider.
  4. Spot-check the homepage and a deep page in a browser. Watch srcset images, sidebar widgets, and the header banner — those break silently if missed.

Phase 9 — Deploy

Host-specific recipes in AGENTS.md:

  • Cloudflare Pages — _redirects, _headers, "no build command, no output directory" defaults.
  • Netlify — same _redirects / _headers syntax, plus netlify.toml.
  • Vercel — vercel.json with redirects / headers.
  • Generic — nginx try_files, Apache Options +MultiViews.

Gotchas

These are the things that bit us. Don't repeat them.

  1. Cloudflare bot protection 403s the default Wget/1.x UA. Always set a real browser UA + Accept / Accept-Language headers (recipe). If you see 403 Forbidden after a burst of requests, that's it — back off, switch UA, retry.

  2. Cross-page link rewriting only works in a single wget invocation. wget's -k only rewrites to local paths it sees in the current run. If a page was downloaded in a separate invocation (e.g. to recover from a 403 on one URL), its links to the rest stay absolute. Solution: redo the full scrape once you have the right UA. Don't piecemeal it. If you're scraping at scale (10K+ URLs) and can't fit in one run, scrape in batches and re-run scripts/rewrite-paths.py afterwards as the canonical pass — -k's output is then redundant.

  3. Default publish directory by host. Cloudflare Pages serves the repo root when no build command is configured. Netlify and Vercel also default to root. If you scraped into output/, either move files to the repo root (git mv output/* .) or configure the host to publish from output/. Symptom of the wrong setup on Pages: every URL 404s with R2-style headers (access-control-allow-origin: *, cache-control: no-store) instead of a Pages-branded 404.

  4. WordPress Offload Media plugins route /wp-content/uploads/ to R2 / S3 buckets. wget may successfully fetch an image even when later direct access 404s (intermittent or partial bucket sync). Trust your local copy — that's why we scrape and self-host.

  5. Sitemaps and the Yoast XSL aren't linked from HTML. wget -p won't find them. Fetch explicitly in Phase 1.

  6. Filenames with ?ver=... query strings. wget keeps these as literal filenames; HTML uses %3F encoding. Standard servers (Pages, Netlify, Vercel, python -m http.server) URL-decode and serve correctly. Don't try to "clean these up" unless something actually breaks.

  7. og:url, canonical, JSON-LD stay absolute. They identify the canonical resource and are correct as-is when redeploying to the same domain. Only rewrite if changing domains.

  8. sed -i '' is macOS / BSD only. GNU sed needs sed -i (no empty-string argument). Recipes in AGENTS.md flag the macOS-isms; default to the Python scripts where there's a choice — they're portable.

Output structure

<repo-root>/
  index.html                 ← homepage
  <slug>/index.html          ← one per URL from sitemap
  wp-content/                ← assets (themes, uploads, plugins)
  wp-includes/               ← block library CSS, et al.
  avatars/                   ← self-hosted Gravatars (Phase 6)
  sitemap_index.xml
  page-sitemap.xml           ← + any other child sitemaps
  wp-content/plugins/wordpress-seo/css/main-sitemap.xsl
  robots.txt
  _redirects                 ← optional, host-specific
  _headers                   ← optional, host-specific

Push to a git host and connect to the static host with no build command and no build output directory — defaults work.

Version history

  1. v0.5 GitHub ↗
    Original release notes

    ## What's new in 0.5 ### Self-updating skills - Every skill's pre-flight update check is now **consent-gated self-install**. When a skill detects it's behind the manifest, it offers to update itself — on agreement, it downloads the `.skill` from the latest release and unpacks it over the installed skill directory. The unpack path is resolved from where the running skill lives, so this works for any agent whose skills directory is writable, not just Claude Code. - All skills bumped a minor to carry the new flow: `astro-seo` → 0.6, `readability-check` → 0.5, the rest → 0.4. ### Astro SEO skill - Updated for `@jdevalk/astro-seo-graph` 1.1.1 and 1.2.0. - **1.1.1 bug fixes folded in.** `validateInternalLinks` now recognises `public/` assets as valid link targets (the `skip` callback trims back to just SSR-only routes and dynamic params), and `validateMetadataLength` no longer truncates descriptions at raw apostrophes — both workarounds removed. - **1.2.0 markdown alternates.** New **Should** in category 6 (agent discovery): serve clean `.md` copies of every page for AI agents. Integration example enables `markdownAlternate: true` (gated on wiring the route first), and a new Phase 2 subsection covers `createMarkdownEndpoint`, route-before-discovery-link ordering, Cloudflare Transform Rules for `Accept: text/markdown` content negotiation, and the `renderMarkdownAlternate` export. ### Repository - Reframed as **agent skills** rather than Claude Code-specific — repo tagline, README intro, and the self-install flow all drop the Claude Code hardcoding. - `.claude/` session state is now gitignored. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically. Or, for any agent that supports the skills format, unzip the `.skill` (or clone the repo) and copy the skill folder into your agent's skills directory. Once installed, the skill will offer to keep itself up to date.

  2. v0.4 GitHub ↗
    Original release notes

    ## What's new in 0.4 ### Version tracking across all skills - Every skill now declares a `version:` in its frontmatter and runs a pre-flight update check against [`versions.json`](https://raw.githubusercontent.com/jdevalk/skills/main/versions.json), so you're told when the installed copy is behind the latest release. - CI validates that manifest entries and frontmatter versions stay in sync. ### Astro SEO skill - Updated for `@jdevalk/astro-seo-graph` 1.0 and 1.1. Category 4 flags missing `alt` attributes; category 5 notes that IndexNow excludes `/404` by default in ≥ 1.0.1; category 9 enables `validateImageAlt`, `validateMetadataLength` (title 30–65, description 70–200), and `validateInternalLinks` (with the `skip` escape hatch pre-wired for `/images/`, `/fonts/`, `/api/`). - Fixed validator option names: `validateDuplicateMeta` → `validateUniqueMetadata`; dropped non-existent `validateSchema`. - `llmsTxt` now passes the required options object (`title`, `siteUrl`, …) rather than a boolean. - IndexNow is gated on a production-host env check (`CF_PAGES`/`VERCEL_ENV`/`CONTEXT`) so local `npm run build` and preview deploys don't ping the endpoint and invalidate the key. - OG image section replaced with a concrete recipe: satori for text-heavy, sharp-composite for photo-heavy, woff2 fonts with locale fallbacks, minimal route sketch. - Upgrade step calls out the 1.0.0 migration (`buildAstroSeoProps` → `buildSeoContext`) and the three silent bugs the rewrite fixes (articlePublisher rendering, canonical on noindex, duplicate og:image and robots tags). ### Readability check skill - New **metadata mode** for short strings (page titles, meta descriptions, schema `description` fields, FAQ answers, profile bios) where Flesch and paragraph-level checks don't apply. Checks front-loading, concreteness, aggressive filler-cutting, active voice, title/description duplication, difficult words, SERP-truncation fit, and one-idea-per-field. Output is per-string ✓/⚠/✗ with rewrites. ### Repository - README intro now names all five skill domains (GitHub, WordPress, EmDash, Astro, readability) and the installation section splits Claude Code one-click from a manual-copy path for any agent that supports the skills format. - Repo tagline and topics refreshed. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically. Or, for any agent that supports the skills format, unzip the `.skill` (or clone the repo) and copy the skill folder into your agent's skills directory.

  3. v0.3 GitHub ↗
    Original release notes

    ## What's new in 0.3 ### Astro SEO skill - Document `llms.txt` support shipped in `@jdevalk/astro-seo-graph` 0.9.0. Category 6 (agent discovery) gains a **Should** check for `llms.txt` at the site root, the integration config example enables `llmsTxt: true`, and a new Phase 2 subsection covers auto-collection and the `sections` / `filter` / `autoSectionName` / `outputPath` tuning options plus the `renderLlmsTxt` export. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.

  4. v0.2.1 GitHub ↗
    Original release notes

    ## What's new in 0.2.1 ### Astro SEO skill - Phase 0 now checks the installed `@jdevalk/astro-seo-graph` version against npm and flags drift; Phase 2 has an explicit upgrade step with a changelog pointer. ### Repository hardening - Stricter skill validation ([#1](https://github.com/jdevalk/skills/pull/1) by @dknauss): closing-delimiter check on frontmatter, `name:` must match directory, referenced support files must exist, `evals.json` validated when present. - Validator extracted to `.github/scripts/validate-skills.sh` so it can run locally. - Validation triggers expanded to `references/`, `evals/`, and `test-cases/` paths. - `workflow_dispatch` added to validation workflows for manual re-runs. - Baseline contributor files: `CONTRIBUTING.md`, `SECURITY.md`, `CODE_OF_CONDUCT.md`, `SUPPORT.md`, PR template, issue templates, Dependabot for GitHub Actions. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.

  5. v0.2 GitHub ↗
    Original release notes

    ## What's new in 0.2 ### New skills - **📖 Readability Check** — Audits blog post drafts calibrated for L2 English readers. Nine checks (paragraph structure, opening paragraph, tiered sentence length, passive voice, difficult words, filler/hedging, transitions, variation, heading hierarchy) with a Flesch Reading Ease score and per-category status. - **🚀 Astro SEO** — Audits and improves SEO for Astro sites across nine categories. Routes most fixes through [`@jdevalk/astro-seo-graph`](https://github.com/jdevalk/seo-graph): `<Seo>` component, linked JSON-LD graph, per-collection sitemaps with git-based lastmod, IndexNow, auto-generated OG images, schema endpoints, FuzzyRedirect, broken link checker in CI, and deployment-target-aware performance headers (Cloudflare / Netlify / Vercel). - **🔷 EmDash GitHub Actions** — Sets up CI/CD workflows for EmDash plugins (TypeScript type-check, ESLint, Vitest, npm publishing). ### Improvements - `github-repo`, `github-profile`, and `wp-readme-optimizer` now chain into `readability-check` on generated prose, with skill-specific guidance on which sections matter most. - Source blocks converted to expandable `<details>` to keep the README scannable. ## Install Download the `.skill` file for the skill you want and open it — Claude installs it automatically.

Only the five most recent versions are shown. View full version history at the source ↗

Current listing version

0.0.1

Verify the source revision ↗

Safety and assessment details

Quality assessment

Out of 100 · Assessment report from SkillPi LAB.

Scenario Value92/100

Highlights

  • 解决 WordPress 站点静态化这一明确的高频需求,适用于归档、迁移、性能优化等多种场景
  • 提供完整的端到端解决方案,从 sitemap 抓取到部署,覆盖主流静态主机平台
Trigger Precision85/100

Highlights

  • 触发词精准完整,覆盖 scrape/freeze/archive/static-ify/move to [host] 等多种用户表达方式
  • 边界清晰,明确区分 WordPress 特定逻辑与通用 CMS 静态化流程
Structure and Standards90/100

Highlights

  • Phase/步骤划分清晰,每个阶段有明确目标和出口条件
  • 包含详细的端到端示例和 host-specific 部署配置说明
  • frontmatter 完整,文档结构良好,易于理解和执行
Execution Reliability80/100

Areas to improve

  • 引用文件缺失 Reported severity: Major

    SKILL.md 中引用了 AGENTS.md 和 scripts/ 目录下的多个 Python 脚本(如 rewrite-paths.py, insert-banner.py, strip-wp-runtime.py, selfhost-gravatars.py),但这些文件未在 ZIP 包中提供

    Recommendation: 请补充所有被引用的脚本文件和 AGENTS.md 文档,或明确说明这些文件将由 Skill 运行时自动生成/下载

Highlights

  • 工具来源明确(wget, Python 脚本),参数使用正确
  • 覆盖了主要异常情况处理(Cloudflare bot protection, link rewriting, asset fetching)
  • 在 Phase 0 设置了用户意图确认机制,避免误操作
Evidence Verifiability (mean of the first four)87/100

The arithmetic mean of the first four original scores, rounded to a whole number.

Static text checks

100 / 100 · skillpi-20261123-no-r3-v1

No current rules matched the text.

This score reflects rule matches in the text and is provided for reference before use. It excludes attachments and runtime behavior.

Permissions and checks before use

Automatically summarized from this main document. Matches may be examples or defensive advice; they are not actual permission declarations. Attachments, external dependencies and runtime behavior are not covered.

These common operations were not identified in the main document. This does not mean no permissions or risks exist.

These notices grant no permissions. Your host tool must still confirm file changes, secrets, external transfers or costs as needed.

Security rating and access scope

safe · Static evidence review; not a runtime safety guarantee.

Not specified in the source documentation.

Before use, confirm and authorize actual file access, external services and network destinations in your host. This review grants no runtime permissions.