| 开发者 | aouwal |
|---|---|
| 更新时间 | 2026年10月22日 15:43 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
url() and @import references.<picture>, <source>, <track>, <template> and custom-element markup intact.404.html page, plus sitemap.xml and robots.txt._redirects and _headers files, both on by default.srcset and <picture> sources.<picture>, <source>, <video>, <track>, <template> and custom elements survive the export.wp aouwal-static-export run._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.
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
aouwal-static-site-export folder to /wp-content/plugins/.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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
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.
Yes. The export runs in batches, which keeps each request short and avoids server timeouts. If your server is slow, lower the batch size in Settings. Very large sites take more time and produce a larger ZIP file. 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 large video or archive cannot run the export out of memory. Raise the limit if you need to export big media files.
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.
<picture> and <source>, <video> and <track>, <template> blocks and custom elements survive the export without being re-nested.sprite.svg#icon icons keep working after asset localization.languages/aouwal-static-site-export.pot./*/feed/ /:splat/feed/index.xml 200.wp_remote_get) exclusively.