PHPackages                             slogsdon/staticwp - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Caching](/categories/caching)
4. /
5. slogsdon/staticwp

ActiveWordpress-plugin[Caching](/categories/caching)

slogsdon/staticwp
=================

Converts your WordPress blog into a static site

v1.5.0(11y ago)834[3 issues](https://github.com/slogsdon/staticwp/issues)MITPHP

Since Apr 25Pushed 11y ago2 watchersCompare

[ Source](https://github.com/slogsdon/staticwp)[ Packagist](https://packagist.org/packages/slogsdon/staticwp)[ Docs](https://github.com/slogsdon/staticwp)[ RSS](/packages/slogsdon-staticwp/feed)WikiDiscussions master Synced 1w ago

READMEChangelogDependencies (1)Versions (3)Used By (0)

StaticWP
========

[](#staticwp)

Converts your blog into a static site.

Description
-----------

[](#description)

Have performance issues? StaticWP converts your blog into a static site, so you don't have to worry.

Installation
------------

[](#installation)

Upload the StaticWP plugin to your site, and activate it! Yep, that's it!

Optionally, you can set your web server to look in the storage directory (default is `staticwp/_site/`in your uploads directory) for files prior to letting Wordpress take over control.

Hooks
-----

[](#hooks)

Need to modify how StaticWP works? Look to an action or a filter to accomplish what you need.

### Actions

[](#actions)

#### `staticwp_pre_cache_hit`

[](#staticwp_pre_cache_hit)

Called prior to outputting a cache hit to the client.

Params:

- `$_SERVER['REQUEST_URI']` - `string|null`

#### `staticwp_post_cache_hit`

[](#staticwp_post_cache_hit)

Called after outputting a cache hit to the client.

Params:

- `$_SERVER['REQUEST_URI']` - `string|null`

#### `staticwp_cache_miss`

[](#staticwp_cache_miss)

Called when a requested post does not exist in the cache.

Params:

- `$_SERVER['REQUEST_URI']` - `string|null`

#### `staticwp_pre_cache_update`

[](#staticwp_pre_cache_update)

Called prior to saving a post's static HTML to disk.

Params:

- `$post_id` - `integer`

#### `staticwp_post_cache_update`

[](#staticwp_post_cache_update)

Called after saving a post's static HTML to disk.

Params:

- `$post_id` - `integer`

### Filters

[](#filters)

#### `staticwp_preload_post_types`

[](#staticwp_preload_post_types)

Allows a developer to modify the list of post types to preload. Default/starting value is `array('post', 'page')`.

Params:

- `$post_types` - `array(string)`

#### `staticwp_preload_{$post_type}_posts`

[](#staticwp_preload_post_type_posts)

Allows a developer to modify the list of posts to preload. By default, all published posts of type `$post_type` will be used and will be ordered by `post_date` in descending order.

Params:

- `$post_ids` - `array(integer)`

#### `staticwp_cache_hit_contents`

[](#staticwp_cache_hit_contents)

Allows a developer to modify the contents of a post's static HTML prior to ouputting to the client.

Params:

- `$contents` - `string`

#### `staticwp_cache_update_contents`

[](#staticwp_cache_update_contents)

Allows a developer to modify the contents of a post's static HTML prior to saving to disk.

Params:

- `$contents` - `string`
- `$post_id` - `integer`

#### `staticwp_cache_destination`

[](#staticwp_cache_destination)

Allows a developer to modify the storage directory for the static HTML files.

Params:

- `$dir` - `string`

Changelog
---------

[](#changelog)

### 1.5.0

[](#150)

*Release Date - 25th April, 2015*

- Add actions.
- Add filters.
- Fix bug with `StaticWP\StaticWP` not qualifying `Exception` before its use.

### 1.4.2

[](#142)

*Release Date - 25th April, 2015*

- Fix issue with preload.
- Fix issue with uninstall.

### 1.4.1

[](#141)

*Release Date - 9th March, 2015*

- Fix misuse of `wp_mkdir`.

### 1.4.0

[](#140)

*Release Date - 9th March, 2015*

- Make preloading safer.
- Ensure more than posts are compiled.
- Allow comments to be added
- Fix bug when files are recompiled.

### 1.3.0

[](#130)

*Release Date - 4th March, 2015*

- Refactor frontend and admin into separate classes.
- Abstracted HTML into templates and `StaticWPView`.
- Add admin menu pages.
- Allow users to preload site.

### 1.2.0

[](#120)

*Release Date - 4th March, 2015*

- Improve directory resolution.

### 1.1.1

[](#111)

*Release Date - 4th March, 2015*

- Fix bug with plugin name.

### 1.1.0

[](#110)

*Release Date - 3rd March, 2015*

- Add deactivation hook for cleanup.
- Add uninstall hook for cleanup.
- Move storage directory to uploads directory.

### 1.0.0

[](#100)

*Release Date - 3rd March, 2015*

- Initial release.
- Does basic static file generation.
- Sends file if it exists only for `GET` requests.

License
-------

[](#license)

StaticWP is released under the MIT License.

See [LICENSE](https://github.com/slogsdon/staticwp/blob/master/LICENSE) for details.

###  Health Score

28

—

LowBetter than 52% of packages

Maintenance13

Infrequent updates — may be unmaintained

Popularity13

Limited adoption so far

Community8

Small or concentrated contributor base

Maturity64

Established project with proven stability

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

2

Last Release

4063d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/ae9739f6c5a88f993d261d12627d43305c71b97951834d3ffbb488a4b5722445?d=identicon)[slogsdon](/maintainers/slogsdon)

---

Top Contributors

[![slogsdon](https://avatars.githubusercontent.com/u/647624?v=4)](https://github.com/slogsdon "slogsdon (23 commits)")

---

Tags

wordpresscachestaticwp

### Embed Badge

![Health badge](/badges/slogsdon-staticwp/health.svg)

```
[![Health](https://phpackages.com/badges/slogsdon-staticwp/health.svg)](https://phpackages.com/packages/slogsdon-staticwp)
```

###  Alternatives

[wp-media/wp-rocket

Performance optimization plugin for WordPress

7501.3M3](/packages/wp-media-wp-rocket)[helsingborg-stad/municipio

A bootstrap theme for creating municipality sites.

4028.3k10](/packages/helsingborg-stad-municipio)[rtcamp/nginx-helper

Cleans nginx's fastcgi/proxy cache or redis-cache whenever a post is edited/published. Also provides cloudflare edge cache purging with Cache-Tags.

23517.0k1](/packages/rtcamp-nginx-helper)[rarst/fragment-cache

WordPress plugin for partial and async caching of heavy front-end elements.

14115.3k2](/packages/rarst-fragment-cache)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
