newsletter emailing

Stay on top with regular WordPress updates.

Subscribe to our newsletter(s) and get the latest stories in your mailbox!

Introducing the HTML API in WordPress 6.2

Date:

This post was co-authored by Adam Zielinski @zieladam and Dennis Snell @dmsnell

WordPress 6.2 introduces WP_HTML_Tag_Processor – a tool for block authors to adjust HTML tag attributes in block markup within PHP. It’s the first component in a new HTML processing API.

Updating HTML in WordPress has always required using uncomfortable tools. Regular expressions are difficult and prone to all kinds of errors. DOMDocument is resource-heavy, fails to handle modern HTML correctly, and isn’t available on many hosting platforms.

WP_HTML_Tag_Processor takes the first step towards bridging this gap.

The Tag Processor can reliably update HTML attributes

The Tag Processor

This is the first part of the article

Introducing the HTML API in WordPress 6.2

wpforms banner 01 468x602x