Static Cache Wrangler

plugin banner

Transform your WordPress site into a fully self-contained static website — fast, lightweight, and completely offline-ready.

Author:derickschaefer (profile at wordpress.org)
WordPress version required:5.0
WordPress version tested:6.9.4
Plugin version:2.1.6
Added to WordPress repository:12-11-2025
Last updated:19-03-2026
Rating, %:0
Rated by:0
Plugin URI:https://moderncli.dev/code/static-cache-wrang...
Total downloads:558
plugin download
Click to start download

Static Cache Wrangler is a lightweight, low‑resource static site generator and HTML export engine for WordPress. It automatically creates self‑contained, URL‑agnostic static pages of your site — perfect for anyone who needs to preserve, distribute, or accelerate WordPress content.

Originally developed as a command‑line tool for WP‑CLI, it has evolved into composable, zero‑impact tooling that supports administrators, developers, and site owners alike. Whether you’re archiving a client project, deploying to a CDN, or creating a portable offline version that runs anywhere, Static Cache Wrangler delivers fast, CDN‑ready HTML output without complex setup.

Technically, the plugin uses an asynchronous, lazy‑loading build mechanism that generates static pages as visitors browse your site. Over time, your entire site is exported as lightweight static HTML.
Free companion plugin STCW Coverage Assistant adds real‑time build monitoring and manually triggered full‑site generation for any uncached pages.

Unlike traditional static‑site plugins that require full crawls or database schema changes, Static Cache Wrangler is zero‑impact:
* Does not add custom database tables or modify your schema
* Automatically cleans up all plugin options, cron jobs, and transients upon uninstall
* Keeps your WordPress database completely untouched
* Runs all caching processes asynchronously in the background
* Offers an optional performance profiler for granular resource and execution insights

Perfect for:
* Creating fully offline or portable copies of WordPress sites
* Rsyncing to read‑only Nginx failover servers for high availability
* Publishing WordPress content to Amazon S3®, Netlify®, or other static CDNs
* Geo‑distributing static HTML for ultra‑fast global reads
* Archiving, demos, and secure client deliverables
* Small to mid‑sized sites (≈ 100 pages +) — upcoming assistant plugin expands this to 1 K pages
* Multisite administrators needing scalable static‑cache exports

A demo site created using this plugin can be found at Cache Wrangler Demo Site which is a static version of this WordPress site

Static Cache Wrangler turns WordPress into a fast, secure, and portable static‑site generator — with no database changes, no vendor lock‑in, and no maintenance overhead.

Detailed Testing and Profiling:
* Triggering of page rendering requires 1-2MB of PHP memory for the duration of the process.
* Average processing duration is less than 500 ms (meaning memory consumption is quickly released)
* Average asset (JS, CSS, image) batch processing is less than 100 ms
* WordPress Core and theme rendering is generally 20-25 MB; SCW usage keeps total memory below 30 MB
* CLI commands are even more efficient

Funding Model
* This plugin and all companion plugins will remain 100% free (true WordPress style)
* Want to make a donation? Consider purchasing a copy of the author’s book on command-line interfaces for yourself or as a gift.

Modern CLI Book

How It Works

  1. Enable static site generation using the toggle in the sidebar.
  2. As users browse your site normally, each page visit creates a static HTML file.
  3. Assets (CSS, JS, images, fonts) are automatically are queued and asyncronously downloaded and localized.
  4. Processing happens in the background and can be paused anytime.
  5. Use free companion plugin to monitor and accelerate cache creation STCW Coverage Assistant
  6. Download the complete static site as a ZIP file.
  7. Extract and open index.html in any browser — it works completely offline.

Key Features

What’s New in 2.1.6:

2.1.6

Version 2.1.6 Adds ghost file protection for environments where PHP memory based failures cause the HTML generation process to fail rendering blank HTML files.

What’s New in 2.1.5:

2.1.5

Version 2.1.5 fixes auto asset processing script loading, ensures STCW_ASYNC_ASSETS false mode processes assets immediately, prevents endless retries for failed asset downloads, and removes duplicate assets in ZIP exports.

What’s Fixed in 2.1.3:

2.1.3

Version 2.1.3 fixes errantly cached files and directories related to index.php and admin in URLs.

What’s New in 2.1.2:

2.1.2

Version 2.1.2 introduces configuration details in addition to file locations on a key admin card.

What’s New in 2.1.1:

2.1.1

Version 2.1.1 introduces cache file timestamps, staleness checks, and adds sitemap creation to both the GUI and CLI zip file creation.

What’s New in 2.1.0:

2.1.0

Version 2.1.0 introduces static sitemap generation – a file system-based approach that creates sitemaps from your actual cached files rather than the WordPress database.

This update enables true static sitemaps that work in exported sites without WordPress, PHP, or a database connection – perfect for deployments to S3, Netlify, GitHub Pages, or any static hosting platform.

New WP-CLI Commands

  • wp scw sitemap – Generate sitemap.xml from cached static files
  • wp scw sitemap-delete – Remove sitemap files

Why File System-Based?

Traditional WordPress sitemap plugins (Yoast SEO, Rank Math) query the database dynamically. This works great for live sites, but fails for static exports because there’s no PHP or database available.

Static Cache Wrangler scans your actual cached index.html files to build the sitemap, ensuring:

  • Perfect accuracy – sitemap matches exported content exactly
  • True portability – works without WordPress/PHP/database
  • SEO compliance – search engines see what users see
  • Deploy anywhere – S3, Netlify, GitHub Pages, any static host

Sitemap Features

  • Generates sitemaps.org compliant XML sitemap
  • Creates XSL stylesheet for browser viewing
  • Calculates priorities automatically (homepage = 1.0, deeper pages = 0.4)
  • Assigns smart change frequencies (homepage = daily, pages = monthly)
  • Includes last modification times from file metadata
  • Developer filter hook: stcw_sitemap_changefreq
  • Multisite compatible with isolated sitemaps per site
  • Fast performance: ~50-100ms per 100 cached files

Typical Workflow

`

wp scw enable # Enable generation

Browse your site…

wp scw process # Process assets
wp scw sitemap # Generate sitemap (NEW!)
wp scw zip # Export with sitemap included

Deploy to S3/Netlify…

`

View in Browser

Open https://your-site.com/sitemap.xml – the XSL stylesheet transforms it into a readable HTML table with color-coded priorities and sortable columns.

Technical Implementation

  • New STCW_Sitemap_Generator class scans cached directory recursively
  • Uses WordPress Filesystem API for all file operations
  • Proper output escaping and sanitization throughout
  • No database queries – pure file system operations
  • Multisite compatible with isolated sitemaps per site
  • Performance optimized: ~50-100ms per 100 files, ~2MB memory for 1,000+ pages

GUI Coming Soon

This release is CLI-only to validate the approach and gather user feedback. A visual interface in WordPress admin is planned for version 2.2.0.

Compatibility

  • WordPress 6.8.3
  • PHP 7.4, 8.0, 8.1, 8.2, 8.3
  • Multisite compatible
  • WP-CLI required for sitemap generation

What’s New in 2.0.7:

2.0.7

Version 2.0.7 is a major compatibility enhancement release, focused on improving support for Kadence Blocks and all Gutenberg block plugins that rely on dynamic JavaScript and CSS enqueues.

This update improves the accuracy of static exports by capturing all front-end assets that WordPress prints dynamically—including those output by wp_print_scripts() and wp_print_footer_scripts()—ensuring that interactive block functionality is preserved outside of WordPress.

Compatibility Improvements

  • Full Kadence Blocks compatibility – Global front-end scripts and CSS are now correctly captured, enabling buttons, accordions, icons, Lottie animations, progress bars, and other JS-driven components to function in static exports.
  • Enhanced Gutenberg block support – STCW now reliably detects and exports front-end assets from all major block suites (Spectra, Stackable, GenerateBlocks, CoBlocks, Otter, etc.).
  • Improved script capture logic – Dynamically enqueued scripts are now collected before theme rendering, eliminating missing-asset issues for blocks that load JS only when present on a page.
  • Better preservation of front-end behavior – Assets required for tooltips, animations, scroll effects, responsive layouts, and block initialization are now exported consistently.
  • Resolved blank-page edge cases – Updated capture timing ensures no interference with WordPress’s script printing lifecycle, preventing rendering conflicts.

Technical Enhancements

  • Added an early script-queue flush to collect output from:
    • wp_print_head_scripts()
    • wp_print_scripts()
    • wp_print_footer_scripts()
  • Captured script output is appended to the main buffer before asset extraction, ensuring regex-based scanners detect dynamically enqueued JS/CSS.
  • Improved compatibility with theme and plugin lifecycle order by isolating script capture from template rendering.
  • Enhanced support for plugins that insert block assets conditionally based on block presence.
  • Increased reliability of static exports for mixed-content layouts and advanced interactive block patterns.

WP-CLI Commands

Full control without the dashboard:

  • wp scw enable – Enable static generation
  • wp scw disable – Disable static generation
  • wp scw status – View current status and statistics
  • wp scw process – Process all pending assets
  • wp scw clear – Remove all generated static files
  • wp scw zip – Create a ZIP archive of the site
  • wp scw sitemap – Generate sitemap.xml from cached files
  • wp scw sitemap --target-url=<url> – Generate sitemap for deployment URL
  • wp scw sitemap-delete – Remove sitemap files

Advanced Configuration

Server Requirements

  • PHP: 7.4 or higher
  • WordPress: 5.0 or higher
  • PHP Extensions: ZipArchive (for ZIP export), curl or allow_url_fopen (for asset downloads)
  • Disk Space: Varies based on site size (static files = ~1.5x site size)
  • Permissions: Write access to wp-content/cache/

Performance Characteristics

  • Generation overhead: ~50–100 ms/page
  • Memory: ~2 MB additional per request
  • Asset downloads: Handled asynchronously in background

Disk Space Considerations

Typical Usage:
* Small site (10-50 pages): 50-200 MB
* Medium site (100-500 pages): 200 MB – 1 GB
* Large site (1000+ pages): 1-5 GB

Monitor disk usage via Settings Static Cache or wp scw status.

To reduce disk usage, exclude large pages:
add_filter(‘stcw_should_generate’, function($should, $url) {
if (strpos($url, ‘/gallery/’) !== false) {
return false;
}
return $should;
}, 10, 2);

What Gets Downloaded

✅ CSS files, JavaScript files, Images (all formats), Fonts, Favicons, Responsive images (srcset)

❌ External CDN assets (preserved as-is), Third-party embeds (YouTube, Twitter), Video/audio files (intentionally excluded to save space)

Use Cases

Offline Documentation — Generate static, portable documentation sites for offline or air-gapped environments.
Client Deliverables — Deliver static versions that eliminate hosting complexity.
Failover Ready — Rsync to a read-only Nginx® server for uninterrupted uptime.
CDN / Amazon S3® Deployment — Publish static HTML to Amazon S3®, Cloudflare®, or Netlify® for instant global delivery.
Geo Load Balancing — Serve from multiple regions with Cloudflare or Amazon Route53® for high performance.
Archival Snapshots — Capture your site before major redesigns or migrations.

Trademark Recognition and Legal Disclaimer

All product names, logos, and brands referenced in this plugin and its documentation are property of their respective owners.

Static Cache Wrangler (also historically referred to as Static Cache Generator) must always be referenced using all three words — “Static Cache Wrangler.”

The prior name Static Cache Generator is considered a legacy name and is no longer in use, as it did not meet WordPress.org plugin naming standards due to its generic nature. That name was originally selected in good faith to avoid any potential confusion with existing trademarks or brand names.

Prior to renaming, U.S. and international trademark databases were reviewed by independent intellectual property counsel, and no conflicts or registered marks were identified for the phrases “Static Cache Generator,” “Cache Generator,” or “Static Cache.”
Counsel further cited legal precedent confirming that generic terms cannot be trademarked, including:
USPTO v. Booking.com B.V., 591 U.S. ___ (2020)
In re Hotels.com, L.P., 573 F.3d 1300 (Fed. Cir. 2009)
Kellogg Co. v. National Biscuit Co., 305 U.S. 111 (1938)

The current and accepted plugin name Static Cache Wrangler:
– Does not imply, refer to, or associate with the standalone trademark “Wrangler” of Wrangler Apparel.
– Does not imply, refer to, or associate with the standalone trademark “Cache” (U.S. Reg. No. 6094619, registered July 7, 2020).
– Does not imply, refer to, or associate with any trademarks involving the standalone term “Static.”
– Has no connection with Automattic Inc., its employees, or any internal job titles (e.g., “Wrangler”) used within Automattic. The name Static Cache Wrangler does not suggest endorsement, employment, or automation of work performed by Automattic personnel.

This clarification is provided in accordance with U.S. trademark law, WordPress.org plugin repository policies, and general principles of fair use and naming transparency.
(U.S. Reg. No. 6094619 reference: “CACHE,” Registered July 7, 2020; Status: LIVE/REGISTRATION/Issued and Active — TSDR, generated 2025-10-23 08:17:17 EDT.)

Third-Party Trademark Notices

NGINX® is a registered trademark of F5, Inc.
Amazon S3® and Route 53™ are trademarks of Amazon Technologies, Inc.
Netlify® is a registered trademark of Netlify, Inc.
Cloudflare® and Cloudflare Pages™ are trademarks of Cloudflare, Inc.
WP-CLI® and Gutenberg® are trademarks of the WordPress Foundation.
Elementor® is a registered trademark of Elementor Ltd.
Divi® is a registered trademark of Elegant Themes, Inc.
GitHub® is a registered trademark of GitHub, Inc.
YouTube® is a registered trademark of Google LLC.
Twitter® is a registered trademark of X Corp.
ModernCLI.Dev is owned by Derick Schaefer.

This plugin has not been tested by any of the services, platforms, software projects, nor their respective owners.
These names and services are referenced solely as examples of where static cache files might be repurposed, used, uploaded, stored, or transmitted.

This plugin is an independent open-source project and is not endorsed by, affiliated with, or sponsored by any of the companies or open-source projects mentioned herein.

Support

For issues, requests, and documentation, visit:
GitHub – Static Cache Wrangler
Documentation & Guides

Interested in learning more about command-line interfaces and WP-CLI?
Check out ModernCLI.dev — a practical guide to mastering modern CLI workflows.


Screenshots
FAQ
ChangeLog