Sander's Blurbs


Introducing HTMXpress = HTMX for WordPress

I have recently been interested in using HTMX, but there’s not been any activity within the WordPress community as far as I can see. I hope to change that with HTMXpress (pronounced as HTM express).

HTMX allows you to annotate dynamic script style behaviour via custom HTML properties, using progressive enhancement. Perhaps you’re familiar with Hotwire (ruby on rails) or Intercooler.js (htmx predecessor).

The approach

By using the Rewrite Endpoints API to create a custom endpoint; and a bit of custom template logic, we can output a serverside partial or custom theme template.

Using this setup, WordPress can leverage HTML over the wire solutions such as HTMX.

HTMX then allows us to do dynamic serverside based rendering; live search and other features without the overhead and complexity of reactive JavaScript frameworks, whilst benefiting from trusted object and full page caching solutions.

Currently it’s a prototype. I’ll be blogging more about progress as things go on.

4 thoughts on “Introducing HTMXpress = HTMX for WordPress

  1. Hey, I agree that HTMX looks to be a good match for WordPress. Having built an app recently with VUE/Express, I see the value HTMX and a monolithic stack. Have you had any traction on this?

  2. Sorry just got to this. Haven’t spent any more time on this due to other interesting side projects, but happy to discuss any experiences or ideas! Definately something I hope to introduce into more projects and build it out.

  3. Hey, it’s nice to see someone bringing HTMX to WordPress.
    I think HTMX may be a better fit for PHP than React/Vue in some cases.

  4. Hi,
    htmx + _hyperscript + WordPress are a perfect fit. Have been building a complete web app with it for the past year. Will be going live with it in 2023.

    As a big intercooler fan before, I followed the first little steps of htmx and _hyperscript closely ๐Ÿ˜‰

    I am using a REST API approach for everything, with some Timber / TWIG templates for easy template rendering / tweaking.

    Loving the flexibility and endless possibilities, especially after using React in many areas before ๐Ÿ™‚


Comments are closed.