Skip to content
WordPress plugin allowing static site generation w/ security, performance and cost benefits
Branch: develop
Clone or download
leonstafford Merge pull request #338 from fransallen/develop
Add Indonesian Translation and replace flag icons with CDN
Latest commit a241c09 Mar 18, 2019
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github Replace flag icons with Staticaly misc CDN Mar 17, 2019
tests fix tests Feb 17, 2019
views scroll to tab top on change Mar 4, 2019
LICENSE Revert "mv license file to github dir" Jan 28, 2019
wp2static.css syntax tidy Jan 10, 2019
wp2static.php adjust dev version Feb 27, 2019


WordPress plugin to generate a static copy of your site and deploy to GitHub Pages, S3, Netlify, etc. Increase security, pageload speed and hosting options. Connect WordPress into your CI/CD workflow.

English English | 日本語 日本語 | Français Français | 简体中文 Simplified Chinese | Indonesia Indonesia

WordPress as a Static Site Generator

Watch Leon Stafford's talk from WordCamp Brisbane 2018

WordPress as a Static Site Generator

Table of contents

External resources

Opinionated software

  • speed over beautiful code
  • human readable code over short variable names
  • own-code vs adding libraries
  • benchmarking over opinions (performance)
  • less clicks == better UX
  • user configurable options vs developer opinions

WP-CLI commands

  • wp wp2static options --help

  wp wp2static options


  Read / write plugin options


  wp wp2static options


  <list> [--reveal-sensitive-values]

  Get all option names and values (explicitly reveal sensitive values)

  <get> <option-name>

  Get or set a specific option via name

  <set> <option-name> <value>

  Set a specific option via name


  List all options

    wp wp2static options list

  List all options (revealing sensitive values)

    wp wp2static options list --reveal_sensitive_values

  Get option

    wp wp2static options get selected_deployment_option

  Set option

    wp wp2static options set baseUrl ''
  • wp wp2static generate
Generating static copy of WordPress site
Success: Generated static site archive in 00:00:04
  • wp wp2static deploy --test
  • wp wp2static deploy
  • wp wp2static generate
Generating static copy of WordPress site
Success: Generated static site archive in 00:00:04
  • wp wp2static deploy --test
  • wp wp2static deploy
Deploying static site via: zip
Success: Deployed to: zip in 00:00:01
Sending confirmation email...


Modify the initial list of URLs to crawl

  • wp2static_modify_initial_crawl_list
  • Filter hook



example usage

function add_additional_urls( $url_queue ) {
    $additional_urls = array(

    $url_queue = array_merge(

    return $url_queue;

add_filter( 'wp2static_modify_initial_crawl_list', 'add_additional_urls' );

Post-deployment hook

  • wp2static_post_deploy_trigger
  • Action hook



example usage

function printArchiveInfo( $archive ) {
    error_log( print_r( $archive, true ) );

add_filter( 'wp2static_post_deploy_trigger', 'printArchiveInfo' );

example response

Archive Object
    [settings] => Array
            [selected_deployment_option] => github
            [baseUrl] =>
            [wp_site_url] => http://example.test/
            [wp_site_path] => /srv/www/
            [wp_uploads_path] => /srv/www/
            [wp_uploads_url] => http://example.test/app/uploads
            [wp_active_theme] => /wp/wp-content/themes/twentyseventeen
            [wp_themes] => /srv/www/
            [wp_uploads] => /srv/www/
            [wp_plugins] => /srv/www/
            [wp_content] => /srv/www/
            [wp_inc] => /wp-includes
            [crawl_increment] => 1

    [path] => /srv/www/
    [name] => wp-static-html-output-1547668758
    [crawl_list] => 
    [export_log] => 


This repo contains the latest code, which you can clone/download to get the bleeding edge, else install via the official WordPress Plugin page

If you'd like to contribute, please follow the usual GitHub procedures (create an Issue, fork repo, submit PR). If you're unsure about any of that, contact me and I'll be happy to help.

In trying to make development/contributing easier, we'll keep requirements to a minimum. If you prefer Docker, Local by FlyWheel, Valet, Bedrock, Linux, BSD, Mac, they're all fine. This is a WordPress plugin, so anywhere you can run WordPress, you can do development on this :)

Localisation / translations

Localisation has fallen behind on this project. I welcome anyone who can contribute some expertise in this area / help me get the project easier to translate.

Our official translation page on


Please raise an issue here on GitHub or on the plugin's support forum.

There is also a Slack group, for quick discussions among the user community.


When cloning the repo for direct use, clone it into a dir named after the official WP plugin's slug, static-html-output-plugin, this will make life easier.

Sponsorship / supporting open-source

I'm committed (git-pun) to keeping this software open-source and free from selling out user data to a 3rd party. As of version 6, we'll no longer be using Freemius for this reason. We'll accept payments with Snipcart + Stripe, but they will have no knowledge of your WordPress website or any info not required for a payment. The only thing that tracks you on our marketing website is a YouTube embed, which I'll soon switch to an image to avoid that. I rock OpenBSD on my workstation and increasingly on servers because they are an open source project done very well.

There is no big company behind this software, besides a sole proprietership in my name, in order to comply with taxation requirements for me as an Australian resident.

Help keep me doing what I love: building and supporting this software.


You can’t perform that action at this time.
You signed in with another tab or window. Reload to refresh your session. You signed out in another tab or window. Reload to refresh your session.