Static HTML to WP Page Importer
Static HTML to WordPress Page Importer – Batch import multiple HTML files as WP Pages with Gutenberg hybrid support
by Local Custom · github.com/gorun74/static-html-to-wp-page-importer
★ 0stars
0forks
Install
No release zip yet. The repository archive installs, but the folder name will carry the branch suffix and updates will not flow:
wp plugin install https://github.com/gorun74/static-html-to-wp-page-importer/archive/refs/heads/main.zipProposed plugin folder structure
static-html-to-wp-page-importer/
|-- static-html-to-wp-page-importer.php
|-- README.md
|-- assets/
| |-- admin.css
| |-- admin.js
| |-- frontend.css
| `-- frontend.js
`-- includes/
|-- class-shtwppi-admin.php
|-- class-shtwppi-asset-manager.php
|-- class-shtwppi-importer.php
|-- class-shtwppi-plugin.php
`-- class-shtwppi-utils.php
What it does
- Adds a dedicated
HTML Importeradmin page. - Accepts either a ZIP upload or a readable server-side folder path.
- Parses multiple HTML files automatically and creates one WordPress Page per file.
- Uses the first
h1, then<title>, then filename for the page title. - Stores a stable import key in post meta to update existing imported pages instead of duplicating them.
- Imports local image and poster assets into the Media Library and rewrites references.
- Validates uploaded ZIP archives and rejects unsafe paths or unsupported file types before extraction.
- Preserves classes, IDs, and useful
data-*attributes on wrapper/group content. - Detects common effect hooks like parallax, sticky, reveal, slider/carousel and reports manual review points.
- Warns when inline styles or linked local CSS contain
background-imageor relatedurl(...)assets that still need manual migration. - Enqueues lightweight front-end helpers for reveal and parallax behavior.
Installation / use
- Copy this plugin folder into
wp-content/plugins/static-html-to-wp-page-importer. - Activate
Static HTML to WP Page Importerin WordPress Admin. - Open
HTML Importerfrom the admin menu. - Upload a ZIP of your static export or enter an absolute server path to the extracted folder.
- Run the import and review the generated logs, warnings, and created pages.
Known limitations / manual review points
- Complex sliders, custom script-driven animations, and framework-specific interactions are preserved as markup but may still need manual JS replacement.
- The importer strips script tags from imported page content to avoid carrying over unsafe or duplicate scripts.
- Background images referenced through inline styles or CSS files are detected and logged, but they are not automatically imported into the Media Library in this first version.
- Gutenberg conversion is intentionally hybrid: semantic nodes are mapped into blocks where practical, while complex wrappers fall back to preserved HTML/group markup for layout fidelity.
- PHP linting was not executed in this workspace because
phpis not installed in the current shell environment.