Linux 软件免费装
Banner图

Aouwal Static Site Export – Static Site Generator

开发者 aouwal
更新时间 2026年11月7日 16:51
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

jamstack static site generator static html wordpress export cloudflare pages

下载

1.4.0 1.5.0 1.8.0 1.9.0 1.1.0 1.0.2 1.0.3 1.1.1 1.1.2 1.2.0 1.3.0 1.6.0 1.7.0

详情介绍:

Aouwal Static Site Export is a WordPress Static Site Generator that converts dynamic WordPress websites into static HTML websites. Export complete websites including CSS, JavaScript, images, fonts, sitemap.xml and robots.txt for deployment on Cloudflare Pages, GitHub Pages, Netlify or any static web server. The export is a plain folder of HTML files and assets. You can commit it to GitHub and deploy it on Cloudflare Pages, or host it on any static host or CDN. No WordPress, PHP or database is needed to serve it. Author: Abdul Aouwal, Technical SEO Consultant. Export WordPress to static HTML The plugin turns your published WordPress pages into plain static HTML files. It works in six steps:
  1. It discovers every public URL on your site.
  2. It requests each URL through the WordPress HTTP API and keeps the fully rendered HTML.
  3. It downloads and localizes every asset, including recursive CSS url() and @import references.
  4. It rewrites internal links to portable relative or root-absolute URLs, keeping <picture>, <source>, <track>, <template> and custom-element markup intact.
  5. It removes server-side features that cannot run on a static host.
  6. It packages everything into one ZIP file you can download.
You can export: WordPress static site generator features Deploy to Cloudflare Pages Cloudflare Pages is the fastest path to a live static site. The export already includes the _redirects and _headers files Cloudflare Pages expects, and the Deploy tab walks you through creating a GitHub repository and connecting it to Cloudflare Pages. Once the repository is connected, every push redeploys the site automatically. Export to GitHub Pages The same export folder works on GitHub Pages. Commit the exported files to a repository, enable Pages for the branch or folder you pushed, and GitHub serves the static HTML. Relative links work as they are, so no extra configuration is needed. Netlify, Jamstack and any static host The output is a plain folder of HTML files and assets, which makes it a good fit for any Jamstack workflow. Upload it to Netlify (which also reads _redirects and _headers), Amazon S3, Vercel, a CDN, or any static hosting account. No WordPress, PHP or database is needed to serve it. Automate exports with WP-CLI and cron Aouwal Static Site Export writes a ZIP and a local folder. It does not schedule exports, and it does not push to Netlify, Cloudflare Pages, S3 or any other host by itself. For hands-off deployments, run the export from WP-CLI on a schedule and let cron and your Git host do the rest.
  1. Create a cron job that runs the export and unzips the result into the repository your host watches. The command prints the ZIP path when it finishes, and the last line has the Success: Export complete: prefix:
ZIP=$(wp aouwal-static-export run --batch=10 | tail -n 1 | sed 's/^Success: Export complete: //') unzip -o "$ZIP" -d /var/www/static-repo 2. Commit and push the updated files: cd /var/www/static-repo && git add -A && git commit -m "Static export" && git push 3. Cloudflare Pages, Netlify and Vercel redeploy on every push, so the new static site is live a few minutes after the cron job runs. The command exits with 0 on a clean run, or 1 when some items failed, so your script can stop before pushing a broken build. The ZIP keeps the site structure (path/index.html), so unzip it as a folder, not as a flat file list. Machine-readable output and a custom output path are planned. Pause, resume or cancel an export The Export screen has three controls next to the Start button, so a long crawl no longer has to be left running or killed by closing the tab. Pausing and cancelling take effect between batches, which is one request. A batch that is already running finishes first, so a cancel can take a few seconds to report back on a slow host. Nothing is lost in the meantime: the next request repeats the cleanup. The state is stored on the server, so reloading the screen shows a paused export with its Resume and Cancel buttons. The loop never restarts on its own, because two open tabs would both drive the same queue. WP-CLI has the same controls for a crawl started from the command line: wp aouwal-static-export status wp aouwal-static-export cancel wp aouwal-static-export resume --batch=10 status prints the phase, the processed and pending counts and the last URL, which is handy in a cron log. cancel exits with 1 so a script stops before pushing a partial build. Changed-only export for large sites By default every export re-crawls every page and re-downloads every asset. Settings > Export mode adds a second mode for sites where that takes too long. What a changed-only run re-exports: Unchanged pages are not even requested: their stored fingerprint matches, so the copied file is kept as is. The mode falls back to a full export on its own when the previous files cannot be trusted: a different plugin or WordPress version, a different theme, a different permalink structure or site URL, or any setting that changes the output (post types, archive toggles, URL style, uploads path, stripping options, credit). It also falls back when the previous output folder is missing, or when copying it fails. Files for content that was deleted are removed from the new export, and the log names how many were dropped. A URL that failed keeps its old file and is retried on the next run. Run it once from the command line without changing the saved setting: wp aouwal-static-export run --changed-only --batch=10 wp aouwal-static-export run --full Data stored: one row per page and asset in a custom table ({prefix}aouwal_export_state) holding the URL hash, fingerprint, ETag, Last-Modified, size and the last export that confirmed it. The table is removed when the plugin is uninstalled. Crawl through proxies, staging sites and Basic Auth The Network settings section controls how the export talks to your server. Defaults reproduce the previous behavior exactly, so nothing changes until you edit them. WP-CLI accepts the same timeout, delay and origin for a single run without saving them: wp aouwal-static-export run --timeout=90 --delay=250 --origin=http://wordpress:8080 Basic Auth stays in the settings screen on purpose, so a password never lands in shell history or a cron file. Why use a static WordPress website A static website is faster and safer than a dynamic one. There is no PHP to execute and no database to query, so pages are served as small HTML files, usually from a CDN close to the visitor. There is also much less to attack: no login page, no plugin endpoints and no database on the public server. You keep WordPress for writing and publishing, and export a fresh static copy whenever the content changes. What the export cleans up Not suitable for A static site has no PHP and no database, so features that need a server stop working after the export: If you need those features, keep the dynamic WordPress site, or replace them with third-party services before you go static: a hosted form service, a static search service, and a hosted checkout. Static export works best for content sites such as blogs, documentation, portfolios, marketing pages and company websites.

安装:

  1. Upload the aouwal-static-site-export folder to /wp-content/plugins/.
  2. Activate the plugin in the Plugins screen.
  3. Open the Static Export menu and configure the settings.
  4. Run an export, then download the ZIP file.
  5. Follow the Deploy tab to publish the site.

屏幕截图:

  • Run the export and follow the live progress log, then download the finished ZIP.
  • Deploy with the built-in GitHub and Cloudflare Pages steps, including the generated _redirects and _headers notes.

升级注意事项:

1.9.0 Adds a changed-only export mode that reuses the previous export and re-exports only changed pages and assets, plus WP-CLI --changed-only and --full flags. Full export stays the default, so nothing changes until you switch modes. The database upgrade runs automatically. 1.8.0 Adds automatic retries for transient crawl failures, a crawl health report naming every failed URL and its reason, and a "Retry failed" action plus a WP-CLI retry command. No action needed. 1.7.0 Adds an optional path rewrite that moves /wp-content/uploads/ to a shorter folder such as /uploads/ or /media/ in the export. Off by default; existing exports are unchanged. No action needed. 1.6.0 Adds Pause, Resume and Cancel to the Export screen, so a long crawl can be stopped and continued without losing progress and a wrong export can be cleaned up. New WP-CLI status, cancel and resume commands. No action needed. 1.5.0 Adds a Network settings section: request timeout, delay, concurrency, custom crawl origin, TLS verification and HTTP Basic Auth for staging sites. Defaults keep the previous crawl behavior, so nothing changes until you edit the settings. 1.4.1 Documentation only: real batch size limits, a WP-CLI, cron and Git deployment recipe, and an answer on scheduling and automatic publishing. No action needed. 1.4.0 New name: Aouwal Static Site Export – Static Site Generator. Archives now export their pagination (page 2 and later), HTML5 markup such as picture, source, track and template survives, and SVG sprite fragments are kept. Adds automated checks and a translation template. No action needed. 1.3.0 Adds a Maximum asset size setting (25 MB default), reports failed file writes instead of marking them done, validates every redirect against the SSRF guard, resolves IPv6, and only uses your theme 404 template for real 404s. No action needed. 1.2.0 Several settings now work as described: comment removal, the _redirects file and the RSS feed rules are honoured, and a new setting controls the _headers file. Dotted slugs, .php URLs and subdirectory installs now export to the correct paths. Check the Generated files settings after updating. 1.1.2 Fixes a late failure on hosts without the PHP zip extension. The export is now refused up front with a clear message instead of after a full crawl. Update recommended. 1.1.1 Housekeeping release: removes unused localized admin data and corrects the README project structure. No behaviour change; update at your convenience. 1.1.0 Security release. Export ZIPs now download through signed, expiring links instead of a permanent public URL, and the export folder is protected from direct access. Recommended for every site. 1.0.3 Fixes link hint handling and localizes web app manifest icons in exports. Update recommended. 1.0.2 All remote requests now use the WordPress HTTP API. Update to stay secure and compliant with the WordPress.org plugin guidelines.

常见问题:

How do I export WordPress to HTML?

Install and activate the plugin, open Static Export in the admin menu, choose which post types and archives to include, then run the export. The plugin renders every page, localizes the assets and builds a ZIP file. Download the ZIP, unzip it, and upload the folder to your static host. The Deploy tab has the full walkthrough for GitHub and Cloudflare Pages.

What does Aouwal Static Site Export do?

It is a static site generator for WordPress. It converts your WordPress site into a static HTML site. The plugin crawls each public page, saves the rendered HTML, downloads and localizes all assets, and packages the result into a ZIP file. You can then host the site anywhere without WordPress, PHP or a database.

Does it support custom post types?

Yes. Every public post type is listed in Settings and you choose which ones to export. Products, portfolio items, documentation pages and other custom post types are exported with the same permalink structure they use on your WordPress site.

Does it work with Elementor?

Usually yes. Elementor renders its layout to HTML and CSS on the server, so pages export with their design intact. Widgets that need a server, such as forms, popups with dynamic content and logged-in-only sections, cannot work on a static host and should be tested before you publish.

Does it work with WooCommerce?

Product and category pages can be exported, so a product catalog works as a static site. The cart, checkout, my-account and product search pages are dynamic, so they cannot work without WordPress. The plugin does not convert WooCommerce into a static shop.

Does it export images?

Yes. Images are downloaded and stored in the uploads structure the HTML expects, including srcset and <picture> sources. Images served from a CDN or another domain are localized too when they are reachable. Any single asset larger than the Maximum asset size setting (25 MB by default) is skipped and listed in the log.

Does it export CSS and JavaScript?

Yes. Stylesheets and scripts are downloaded and rewritten to local paths, including CSS url() and @import references, so icons, fonts and background images keep working. Inline styles and inline scripts stay in the page. Files are not minified or combined, so the export matches what your site already serves.

What happens to search and comments?

Search and comments are server-side features, so they cannot run on a static host. The plugin removes search forms, comment forms, comment sections and comment feeds from the export by default. Both cleanup steps can be turned off in Settings, for example when you only need a partial static copy. There is no built-in replacement for them.

Does the export include any credit or branding?

No, not unless you enable it. In Settings, under Attribution, you can turn on an invisible, source-code-only credit. It is off by default and never appears in the browser or in the exported pages your visitors see.

Can I deploy to Cloudflare Pages?

Yes. The export includes _redirects and _headers files, which Cloudflare Pages reads automatically, and the Deploy tab gives you the GitHub and Cloudflare Pages steps. Connect the repository once and every new export redeploys the site.

Can I schedule exports or publish to Netlify automatically?

Not from the plugin settings. Scheduled exports, deploy targets and cache purging are not built in yet. The supported pattern is a cron job that runs wp aouwal-static-export run --batch=10, unzips the ZIP into a Git repository, then commits and pushes. Cloudflare Pages, Netlify and Vercel deploy the new commit automatically. The "Automate exports with WP-CLI and cron" section has the exact commands.

Can I host the exported site anywhere?

Yes. The output is plain HTML, CSS, JavaScript and media, so it runs on any static hosting or CDN: Netlify, GitHub Pages, Cloudflare Pages, Amazon S3, Vercel, or a basic web host. No WordPress, PHP or database is required.

Do I need to know how to code?

No. You run the export from the WordPress admin and download a ZIP file. The Deploy tab gives you copy-and-paste commands for GitHub and Cloudflare Pages, so you can publish the site without writing any code.

Does the plugin change my live site?

No. The plugin only reads your content and writes the export to a files folder inside your own WordPress uploads directory. Your live site, database and settings stay unchanged, and you can delete the export files at any time.

Where are export files stored, and are they public?

Exports are written to wp-content/uploads/aouwal-static-site-export/, the same area WordPress uses for its own export files. The folder is protected from browsing with an index.php file and, on Apache, a .htaccess deny rule. The ZIP is served only through a signed, expiring admin link, never a permanent public URL, and the file disappears when the job is pruned. Nginx ignores .htaccess, so on Nginx either add a deny rule for wp-content/uploads/aouwal-static-site-export/ or move exports outside the web root. Developers can relocate the directory with the aouwal_export_dir filter.

Which WordPress and PHP versions are supported?

The plugin requires WordPress 6.0 or later and PHP 7.4 or later. It is tested up to WordPress 7.1. It uses only the WordPress HTTP API and the WordPress filesystem, so it works on standard shared hosting.

Can I update the exported site later?

Yes. Run a new export to create a fresh ZIP, then push the updated files. On Cloudflare Pages, every push to your connected repository redeploys the site automatically, so updates take only a few minutes.

Can I export only the pages that changed?

Yes. Set Settings > Export mode to "Changed-only export", or run wp aouwal-static-export run --changed-only. The export starts from the last one, keeps every file whose page or asset did not change, and re-exports edited posts, the archives that contain them, the homepage, the posts page and any asset whose ETag or Last-Modified changed. A changed-only run is much faster on a large site because unchanged pages are not requested at all and unchanged assets answer 304 Not Modified. The mode falls back to a full export automatically after a plugin, WordPress or theme update, a permalink or site URL change, or any setting that affects the output. Full export stays the default.

Does a changed-only export upload the whole site again?

Yes, the ZIP still contains the complete site, because the export is a static snapshot rather than a patch. The saving is in the crawl: only changed URLs are fetched and rewritten, and unchanged files are copied from the previous export. If you deploy with rsync or Git, your sync tool still transfers only the files that differ.

Does the plugin work on large sites?

Yes. The crawl runs in batches, and each batch is one request, so a PHP timeout applies to a batch, not to the whole site or to a single page. Batch size is set in Settings and accepts 1 to 50. The default is 5, so a 2,000-page site already exports in 5-page requests. Do not set 50 or 100: 50 is the maximum and 100 is not accepted. Lower it to 2 to 5 on shared hosting, raise it to 10 to 20 on a fast server. WP-CLI uses 10 URLs per batch by default: wp aouwal-static-export run --batch=10 Memory: 256 MB is the practical minimum and 512 MB is comfortable for large media libraries. Any single asset larger than the "Maximum asset size" setting (25 MB by default) is skipped and listed as an error in the log, so one huge video or archive cannot run the export out of memory. Discovery and ZIP packaging each run in a single request on current versions. Sites with tens of thousands of posts can still hit a limit there. If that happens, exclude heavy post types, raise max_execution_time temporarily, or run the export with WP-CLI.

Can I export a staging site protected by HTTP Basic Auth?

Yes. Enter the username and password in Settings > Network > HTTP Basic Auth, then run the export as usual. The plugin sends the Authorization header only to your site's own hosts, so credentials never reach Google Fonts, a CDN or a Gravatar, and the header is dropped when the origin redirects to another domain. The password is stored encrypted and is never rendered back into the settings page or written to the export log. Leave the password field blank to keep the saved value; tick "Remove stored credentials" to delete it. Basic Auth only: cookie-based protection and WordPress "site password" plugins are not supported, and without credentials a protected site still logs HTTP 401 for every URL.

Why does the export time out or get rate-limited?

Two settings in Settings > Network control it. Raise "Request timeout" (60 seconds by default, up to 120) when a single slow page or a large file is abandoned. Add a "Delay between requests" of 200 to 1000 milliseconds when your host or a security plugin rate-limits the crawl. If PHP itself runs out of time, lower "Batch size (concurrency)" instead, because each batch is one PHP request. The same values are available for a single run with WP-CLI: wp aouwal-static-site-export run --timeout=90 --delay=250 --batch=5.

Can I crawl through a Docker container or a reverse proxy?

Yes. Set "Custom crawl origin" to the URL the server can actually reach, for example http://wordpress:8080 for a container name or http://127.0.0.1:8080 for a local proxy. The crawler requests pages and assets from that origin, while every link, canonical URL and sitemap entry still uses the normal site URL, so the exported site is identical to a direct crawl. The origin host is trusted like the site host, so it does not have to be publicly routable. Link-local and cloud metadata addresses such as 169.254.169.254 are always refused, and the origin URL cannot contain a username or password. On a proxy that uses a private certificate authority, choose "Verify against a custom CA bundle" and enter the absolute path to the PEM file on the server.

Is the exported site good for SEO?

Yes. The export keeps your page URLs, titles and content, generates a sitemap.xml and robots.txt, and strips version tags and staging "noindex" meta. Because the pages are static HTML, they load quickly and are easy for search engines and AI systems to crawl.

Can I move or remove /wp-content/uploads/ from the exported URLs?

Yes, optionally. In Settings > Paths, turn on "Rewrite uploads path" and choose a target folder such as "uploads" or "media". When enabled, every reference and file uses the new folder: /wp-content/uploads/2026/01/photo.jpg becomes /uploads/2026/01/photo.jpg, including HTML attributes, CSS url() and @import references, srcset variants and manifest icons. The setting is off by default, so the export keeps the live /wp-content/uploads/ structure byte for byte when it is disabled. It changes URLs only and does not remove other WordPress fingerprints such as generator meta tags or already-localized script paths. Trade-off: old /wp-content/uploads/ links stop working unless you add redirects. The _headers cache rule follows the configured folder. A path that collides with an existing page is reported as an error and is not overwritten.

Can I pause or cancel an export that is already running?

Yes. The Export screen shows Pause and Cancel buttons while an export runs. Pause stops at the end of the current batch and keeps every page and asset already written, so Resume can continue from the next pending URL. Cancel stops the export and deletes the partial output folder and any ZIP, so a wrong or failed export leaves nothing on disk. Both actions are recorded in the log. A cancel adds a line naming the last URL that was processed and how many items had been exported, and the same line is still there after a page reload.

Can I resume an export after closing the browser?

Yes, if you paused it first. The state lives in the database, so reopening the Export screen shows the paused export with its Resume and Cancel buttons and the counts it reached. The crawl does not restart on its own, because two open tabs would otherwise drive the same queue at the same time. An export that was never paused and whose tab was simply closed stays in the "crawling" phase. The screen detects that no batch has touched the output folder for five minutes, marks it as interrupted, and offers Resume or Cancel. From the command line, wp aouwal-static-export status shows the same state.

What happens to the files when an export is cancelled?

They are deleted. Cancel removes the job's output folder and its ZIP, plus the remaining queue rows, so a cancelled export cannot be downloaded or resumed by mistake. Other completed exports are untouched and stay downloadable. The last processed URL is kept in the job log, which is the quick way to see where the crawl stopped. If you cancel because the settings were wrong, fix the settings and start a new export; it begins from a clean folder.

What happens when a page fails to export?

The export retries transient failures automatically. A timeout, an HTTP 429 or a 5xx response is tried again up to two times by default, with a short backoff and respect for the Retry-After header. Permanent errors such as 401, 403 or 404 are not retried, because a second attempt would fail the same way. After the run, the Crawl health section on the Export screen lists every failed URL with its HTTP status or error text, the number of attempts, and the page that linked to a failed asset. The final log line lists the failure reasons too.

Can I retry only the pages that failed?

Yes. When the last export finished with failures, the Export screen shows a "Retry failed" button. It requeues only the errored items, keeps every file that was already written, and rebuilds the ZIP in place, so a single timeout does not force a full re-crawl. From the command line, run wp aouwal-static-export retry. Add --batch=5 to lower the concurrency. The command exits with 1 if failures remain, so a cron job can stop before deploying a partial build.

更新日志:

1.9.0 1.8.0 1.7.0 1.6.0 1.5.0 1.4.1 1.4.0 1.3.0 1.2.0 1.1.2 1.1.1 1.1.0 1.0.3 1.0.2 1.0.1 1.0.0