wp-to-staticConvert a WordPress website to a static site and deploy to Cloudflare Pages. Mirrors the rendered HTML via SSH, extracts only referenced assets (shrinks 1.5GB+ to ~25MB), fixes URLs, self-hosts fonts, strips WordPress cruft, and deploys. Use when migrating a WordPress site to static hosting.
Install via ClawdBot CLI:
clawdbot install abhibavishi/wp-to-staticConvert a WordPress website to a pixel-perfect static site and deploy it to Cloudflare Pages. Zero attack surface, zero hosting cost, instant load times.
Before running this skill, the user MUST have:
gh auth status to verify. If not logged in, run gh auth login first.wrangler whoami to verify. If not logged in, run wrangler login first.
eval "$(ssh-agent -s)"
ssh-add ~/.ssh/your_wp_key
~/.ssh/known_hosts.Required (stop and ask if any are missing):
WP_SSH_HOST โ SSH hostname (e.g., ssh.example.com)WP_SSH_USER โ SSH usernameWP_SSH_PORT โ SSH port (e.g., 18765)WP_SSH_KEY โ Path to SSH private key file (e.g., ~/.ssh/wp_key). Key must have chmod 600 permissions.WP_SITE_URL โ WordPress site URL (e.g., https://example.com)WP_SITE_NAME โ Short project name (e.g., mysite)Optional:
CF_ACCOUNT_ID โ Cloudflare account ID for Pages deploymentGH_REPO_VISIBILITY โ private (default) or publicssh-agent โ keys are loaded into the agent before running, so no passphrase is passed via environment variables or command argumentsStrictHostKeyChecking=no) โ the server must already be in ~/.ssh/known_hostsssh, ssh-agent, rsync, curl, git, gh, wrangler.gh auth status succeeds. If not, tell user to run gh auth login.wrangler whoami succeeds (if CF_ACCOUNT_ID is set). If not, tell user to run wrangler login.chmod 600).Test the connection using the key from ssh-agent:
ssh -i $WP_SSH_KEY -p $WP_SSH_PORT $WP_SSH_USER@$WP_SSH_HOST "echo connected"
If the key requires a passphrase and ssh-agent is not loaded, tell the user:
Please add your SSH key to ssh-agent first:
eval "$(ssh-agent -s)"
ssh-add /path/to/your/key
Then re-run /wp-to-static
If the host key is not recognized, tell the user to connect manually once first to verify and accept the host key:
Please connect to the server once manually to verify the host key:
ssh -i $WP_SSH_KEY -p $WP_SSH_PORT $WP_SSH_USER@$WP_SSH_HOST
Accept the host key, then re-run /wp-to-static
Do NOT use StrictHostKeyChecking=no. Do NOT bypass host key verification.
SSH in and find the WordPress public_html directory. Common locations:
~/www/DOMAIN/public_html/~/public_html/~/htdocs//var/www/html/Confirm by finding wp-config.php. Store path as WP_ROOT.
Run wget --mirror on the server (not locally):
cd /tmp && rm -rf static_mirror && mkdir -p static_mirror && cd static_mirror && \
wget --mirror --convert-links --adjust-extension --page-requisites --no-parent \
--restrict-file-names=windows -e robots=off --timeout=30 --tries=3 --wait=0.5 \
--user-agent="Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7)" \
$WP_SITE_URL/ 2>&1 | tail -30
If wget is not available on the server, fall back to curl locally for rendered HTML.
Create ./build/site (NEVER use the project root as temp dir).
Exclude server-side code and sensitive files. Only static assets (images, CSS, JS, fonts) are needed. PHP files, config files, and other server-side code must NEVER be downloaded.
RSYNC_EXCLUDE="--exclude='*.php' --exclude='wp-config*' --exclude='.htaccess' --exclude='*.sql' --exclude='*.log' --exclude='debug.log' --exclude='error_log' --exclude='.env' --exclude='*.bak' --exclude='*.backup'"
rsync -avz $RSYNC_EXCLUDE server:/tmp/static_mirror/DOMAIN/ ./build/site/
rsync -avz $RSYNC_EXCLUDE server:$WP_ROOT/wp-content/uploads/ ./build/site/wp-content/uploads/
rsync -avz $RSYNC_EXCLUDE server:$WP_ROOT/wp-content/themes/ ./build/site/wp-content/themes/
rsync -avz $RSYNC_EXCLUDE server:$WP_ROOT/wp-content/plugins/ ./build/site/wp-content/plugins/
rsync -avz $RSYNC_EXCLUDE server:$WP_ROOT/wp-includes/ ./build/site/wp-includes/
After rsync, verify no PHP or config files were downloaded:
find ./build/site -name '*.php' -o -name 'wp-config*' -o -name '.htaccess' -o -name '.env' | head -20
If any are found, delete them before proceeding.
This is the key step. Parse all HTML and CSS files to find every referenced local file:
From HTML: src=, href=, data-src=, data-srcset=, srcset=, inline background-image: url()
From CSS: All url() references โ resolve relative paths from CSS file location to site root.
Write the list to ./build/referenced-files.txt, then copy only those files to ./public/ preserving directory structure. This typically shrinks 1.5GB+ down to ~25MB.
In index.html and ALL CSS files:
$WP_SITE_URL/ โ empty string (relative paths).ttf to ./public/fonts/@font-face src: to fonts/filename.ttf for Google Fonts domainsCSS path resolution is critical. If CSS is at wp-content/uploads/cache/file.css:
wp-content/uploads/ โ ../../wp-content/themes/ โ ../../themes/wp-includes/ โ ../../../wp-includes/Remove:
(WordPress, WPBakery, Slider Revolution), (RSS, oEmbed), for fonts.googleapis.comwp-json root references in inline JSONKeep: Email addresses, (update to /)
Create ./public/_headers with aggressive caching for /fonts/, /wp-content/, /wp-includes/*.
Create ./public/_redirects redirecting /wp-admin/, /wp-login.php, /xmlrpc.php, /feed/ โ / (302).
python3 -m http.server from ./public/Before any git operations, remove the ./build/ directory to ensure no server-side code, PHP files, or sensitive data can accidentally be committed:
rm -rf ./build
Verify only ./public/ remains and contains no PHP or config files:
find ./public -name '*.php' -o -name 'wp-config*' -o -name '.htaccess' -o -name '.env'
This must return empty. If not, delete those files before proceeding.
Then deploy:
git init, commit ONLY ./public/ and .gitignoregit config http.postBuffer 524288000 (for binary assets)gh repo create $WP_SITE_NAME --private --source=. --pushCLOUDFLARE_ACCOUNT_ID=$CF_ACCOUNT_ID wrangler pages project create $WP_SITE_NAME --production-branch mainCLOUDFLARE_ACCOUNT_ID=$CF_ACCOUNT_ID wrangler pages deploy ./public --project-name $WP_SITE_NAMEStrictHostKeyChecking=no or bypass SSH host verification./build/ for temp files, ./public/ for output โ only ./public/ is committed./build/ BEFORE any git operations to prevent accidental commits of server-side files./public/ contains no PHP or config files before committingGenerated Mar 1, 2026
A local business with a WordPress site wants to reduce hosting costs and improve security by moving to a static site. They have a simple blog and portfolio but face slow loading times and vulnerability to attacks. This skill automates the conversion, ensuring fast, secure hosting on Cloudflare Pages with minimal technical effort.
A web development agency needs to migrate multiple client WordPress sites to static versions for better performance and lower maintenance. They handle sites with custom themes and plugins, requiring asset extraction and URL fixes. This skill streamlines the process, allowing bulk migrations while preserving design and functionality.
A non-profit organization with a WordPress site seeks to cut hosting expenses and enhance accessibility with faster load times. Their site includes donation pages and event information, but they lack technical expertise. This skill converts the site to static, reducing server dependencies and improving reliability for global audiences.
An e-commerce business uses WordPress for content marketing but wants to separate static content from dynamic store functions to boost SEO and speed. They have product blogs and tutorials that don't require server-side processing. This skill extracts and deploys static content, integrating with existing e-commerce platforms via APIs.
A university or school wants to archive old WordPress course websites as static versions for long-term preservation and reduced maintenance. These sites contain lecture notes, images, and PDFs but are no longer updated. This skill mirrors the content, strips unnecessary code, and hosts it cost-effectively on Cloudflare Pages.
Freelancers offer one-time migration services for clients looking to move from WordPress to static hosting. They charge a flat fee per site, leveraging this skill to automate the technical steps and reduce labor. Revenue comes from service packages that include setup, testing, and post-migration support.
A software-as-a-service platform provides agencies with a managed interface for this skill, offering batch processing and analytics. Subscriptions include automated migrations, monitoring, and integration with other tools. Revenue is generated through monthly or annual plans based on the number of sites migrated.
Consultants offer workshops and training sessions to teach organizations how to use this skill for in-house migrations. They provide custom scripts, security audits, and ongoing advice. Revenue streams include hourly consulting rates, training course fees, and retainer agreements for ongoing support.
๐ฌ Integration Tip
Ensure all environment variables are set and SSH keys are properly configured before running to avoid errors during the migration process.
OpenClaw skill that provides a WordPress REST API CLI for posts, pages, categories, tags, users, and custom requests using plain HTTP.
Publish content directly to WordPress sites via REST API with full Gutenberg block support. Create and publish posts/pages, auto-load and select categories from website, generate SEO-optimized tags, preview articles before publishing, and generate Gutenberg blocks for tables, images, lists, and rich formatting. Use when user wants to publish to WordPress, post to blog, create WordPress article, update WordPress post, or convert markdown to Gutenberg blocks.
Use when developing WordPress themes, plugins, customizing Gutenberg blocks, implementing WooCommerce features, or optimizing WordPress performance and security.
WordPress.com API integration with managed OAuth. Manage posts, pages, sites, and content. Use this skill when users want to create, read, update, or delete WordPress.com posts, pages, or manage site content. For other third party apps, use the api-gateway skill (https://clawhub.ai/byungkyu/api-gateway). Requires network access and valid Maton API key.
ๅๆ็ซ ๅนถๅๅธๅฐ CSDNใไฝฟ็จๆต่งๅจ่ชๅจๅ + ๆซ็ ็ปๅฝใๆฏๆ้่ฟ Telegram ๅ้ไบ็ปด็ ๏ผๆ ้ VNCใ้ๆ blog-writer ๅไฝๆนๆณ่ฎบ๏ผไบงๅบ้ซ่ดจ้ใๆไธชไบบ้ฃๆ ผ็ๆๆฏๆ็ซ ใ
Manage WordPress sites via MCP (Model Context Protocol) through AI Engine. Use for creating/editing posts, SEO analysis, analytics, media management, taxonomy operations, social media scheduling, multilingual content (Polylang), and any WordPress admin task. Requires AI Engine plugin (free) with MCP Server enabled. Also use when asked about WordPress site management, content workflows, or WP-related tasks.