| 开发者 | hosseinkarami |
|---|---|
| 更新时间 | 2026年8月29日 02:23 |
| 捐献地址: | 去捐款 |
| PHP版本: | 7.4 及以上 |
| WordPress版本: | 7.1 |
| 版权: | GPLv2 or later |
| 版权网址: | 版权信息 |
https://example.com/pages/your-slug/. No theme changes, no FTP, no page builder.
It is built for the "I made this page with an AI tool, now how do I get it onto my site?" moment. It includes purpose-built cleanup for Claude Design exports, and works with any self-contained HTML page — from ChatGPT, Gemini, or written by hand. (Tools that export React or Vite projects, such as v0 and Bolt, first need to be built or exported to static HTML.)
Key features
/promo/ instead of /pages/promo/, or make it the site's front pagePOST /wp-json/htmlpp/v1/pages with an application password, or wp htmlpp publish. A Claude Code skill is included in the GitHub repository.htmlpp_sanitizer_rules filter/pages/your-slug/, change to anything you like (e.g. /resources/, /guides/)sales.example.com at your site and pages appear at sales.example.com/your-slug/example.com/blog/pages/your-slug/)htmlpp_loaded, htmlpp_page_published, htmlpp_before_serve, htmlpp_cache_max_age, htmlpp_allowed_asset_mimes, and more)html-page-publisher folder to /wp-content/plugins/ (or install from Plugins → Add New).Yes. Zip the exported folder — index.html at the top level (or inside a single folder), assets in subfolders — and upload the .zip instead of an .html file. Files keep their relative paths, so css/site.css and img/hero.png references work unchanged. Executable files (.php etc.), anything outside the allowed types, and any file containing PHP code are skipped and reported. ZIP import needs PHP's ZipArchive extension, which nearly every host provides; if yours does not, upload the HTML and its files separately.
Tick Save as draft when uploading a new page, or switch a page to Draft in its Page Settings. Drafts return a 404 to visitors and search engines; administrators can view them, and the Preview button gives you a link with a secret token you can share with anyone (use Reset preview link to revoke it). Publish from Page Settings when you are happy.
Yes. In a page's settings, set Custom path to promo to serve it at https://example.com/promo/, or to / to make it the front page. If you later change the path, the old one redirects to the page. Paths that belong to existing WordPress pages or posts, core routes, category/tag/author bases and post-type archives are refused; other rewrite rules (e.g. from other plugins) are not checked, so choose a path you know is free. The front page keeps working for WordPress's own query-string routes (search, previews, REST, feeds).
HTML Pages → Settings → Global snippets. Paste the tags into the head or footer snippet; they are inserted into every published page when it is served (so re-uploading a page never loses them). Pages can opt out individually.
Published pages that are not marked noindex are listed at /wp-sitemap-htmlpp-1.xml, which is linked from WordPress's built-in sitemap index. SEO plugins such as Yoast or Rank Math replace the core sitemap with their own; in that case use the htmlpp_sitemap_entries filter (or HTMLPP_Sitemap::entries()) to feed their sitemap.
Yes. The plugin exposes a REST API at /wp-json/htmlpp/v1 (list, create/replace from an HTML file or ZIP, update HTML or settings, rename, duplicate, files, versions, preview links). Authenticate with an application password (Users → Profile → Application Passwords) for an administrator:
curl -u "admin:xxxx xxxx xxxx xxxx" -F slug=spring-promo -F file=@index.html https://example.com/wp-json/htmlpp/v1/pages
With shell access, wp htmlpp publish spring-promo ./site.zip --overwrite does the same. The GitHub repository ships a Claude Code skill (skills/publish-to-wordpress) so Claude can publish a page it just generated.
Any tool that gives you a single, self-contained HTML file. Claude Design's "Export as standalone HTML" is supported directly, including automatic removal of the runtime wrappers it injects. Pages from ChatGPT, Gemini, or written by hand work as-is. Tools such as v0 and Bolt export React/Vite projects rather than static HTML, so you need to build or export those to plain HTML first.
In wp-content/uploads/html-page-publisher/<slug>/. Each page has its own directory containing an index.html and an assets/ folder for images. Version-history snapshots are kept separately in wp-content/uploads/html-page-publisher-backups/<slug>/. Both folders contain an .htaccess that denies direct access, so pages are only reachable at their public URL.
nginx ignores .htaccess. Pages still work at their public URL, but the raw files could also be fetched from the uploads folder. HTML Pages → Settings shows whether direct access is blocked and gives you a ready-made location block to add to your nginx server configuration. The same applies to Apache or LiteSpeed configured with AllowOverride None.
Open HTML Pages, click Edit on a page. You get the native WordPress code editor for the HTML, a Version History panel to restore earlier saves, and a Files & Assets panel to add, replace, or delete the page's images, CSS, JS, fonts and other files without re-uploading the HTML. Use Replace (rather than uploading a new file) to swap a file while keeping the same name, so existing references in your HTML keep working.
The upload is refused with a message explaining why, unless you tick Replace the existing page. With the box ticked the new HTML replaces the live page and the previous version is saved to the page's version history. Automated workflows can allow overwrites with the htmlpp_allow_overwrite filter.
Yes. The standard DISALLOW_FILE_EDIT (or DISALLOW_FILE_MODS) constant in wp-config.php disables in-dashboard HTML editing, file changes, renaming and replacing existing pages, the same way it disables WordPress's core file editor. Uploading new pages, duplicating and deleting remain available.
Two steps:
sales.yourdomain.com) at the same server as your WordPress site.https://sales.yourdomain.com/your-slug/ in addition to the regular prefix URL.
Only users with the manage_options capability (administrators by default) can upload pages. Uploaded HTML is served as-is, including any <script> tags it contains, so only upload HTML you trust.
No. Uninstalling removes the plugin's settings but leaves the uploaded pages in wp-content/uploads/html-page-publisher/ (and their version-history snapshots in wp-content/uploads/html-page-publisher-backups/) intact, together with their metadata (draft status, custom paths, redirects) so a reinstall does not publish former drafts. Delete those folders and the htmlpp_pages, htmlpp_redirects and htmlpp_path_redirects options manually if you want everything gone.
Yes. Pages are served before WordPress's main query runs, with ETag and Last-Modified headers; conditional requests get a 304 Not Modified and HEAD requests are supported. The page HTML is sent with max-age=0, must-revalidate so edits show immediately; assets get one hour. To let a CDN cache the HTML itself, use the htmlpp_cache_max_age filter:
add_filter( 'htmlpp_cache_max_age', function ( $seconds, $file, $ext, $is_page ) { return $is_page ? 600 : $seconds; }, 10, 4 );
Yes. Rules are a named array of PCRE pattern/replacement pairs:
add_filter( 'htmlpp_sanitizer_rules', function ( $rules, $slug, $context ) { $rules['my-tool-banner'] = array( 'pattern' => '/<div class="made-with">.*?<\/div>/is', 'replacement' => '' ); return $rules; }, 10, 3 );
You can also unset() a built-in rule by its key (for example claude-design-cfasync-script) if it interferes with your markup.
/wp-json/htmlpp/v1 — list, create/replace (JSON HTML or multipart HTML/ZIP + files), update HTML and settings, rename, duplicate, delete, files, version history and restore, preview links. Application-password or cookie+nonce auth; manage_options required.wp htmlpp list|get|publish|update|delete|duplicate|preview|files|versions|restore.HTMLPP_Page_Service (htmlpp()->pages) — one API for every page operation, shared by the admin screens, REST and CLI. Add-ons should use it instead of the storage classes.publish-to-wordpress skill in the repository./promo/ or as the site's front page. Paths used by existing WordPress content are refused.htmlpp_page_meta, htmlpp_page_meta_defaults, htmlpp_page_meta_updated, htmlpp_page_status_changed, htmlpp_page_created, htmlpp_page_renamed, htmlpp_page_copied, htmlpp_page_duplicated, htmlpp_page_html, htmlpp_can_preview, htmlpp_zip_imported, htmlpp_assets_uploaded, htmlpp_asset_replaced, htmlpp_asset_deleted, htmlpp_sitemap_entries, htmlpp_reserved_paths, htmlpp_path_collides, htmlpp_home_reserved_query_vars, htmlpp_zip_allowed_extensions, htmlpp_zip_max_bytes, htmlpp_zip_max_files./wp-content/uploads/html-page-publisher/... now redirect to the page’s real URL instead of breaking, and /pages/your-slug (no trailing slash) redirects only when your site’s permalinks use trailing slashes — otherwise the page is served with a <base> tag so its assets still resolve. Both are filterable (htmlpp_canonical_redirect).unfiltered_html capability, so a multisite site administrator cannot inject scripts a network administrator has not allowed. Override with htmlpp_require_unfiltered_html on hardened single-site installs..htaccess that denies direct access, and Settings shows whether your web server honours it (with an nginx snippet if it does not).ETag, Last-Modified, conditional 304 responses and HEAD support — replacing the previous no-cache headers. Filterable via htmlpp_cache_max_age / htmlpp_cache_control./pages/slug now redirects to /pages/slug/ so relative asset references always resolve, and the page has a single canonical URL.<title>.htmlpp_sanitizer_rules), and a rule that fails on very large exports can no longer blank the page.htmlpp_loaded, htmlpp_upgraded, htmlpp_page_published, htmlpp_page_updated, htmlpp_page_deleted, htmlpp_before_serve, htmlpp_serve_headers, htmlpp_mime_map, htmlpp_allowed_asset_mimes, htmlpp_allow_overwrite, htmlpp_editing_disabled, htmlpp_htaccess_rules, htmlpp_home_path_candidates, and an htmlpp() accessor. htmlpp_sanitizer_rules and htmlpp_sanitize_html now also receive the slug and context.example.com/blog/).post_max_size is refused instead of wiping the page..wp-header-end marker.htmlpp_max_backups (default 10).DISALLOW_FILE_EDIT / DISALLOW_FILE_MODS, mirroring WordPress's core file-editor lockdown.manage_options, MIME-whitelist, and realpath path-traversal protections; backups are stored outside the publicly served directory./pages/).