wp-html-api

Community

Safely read and mutate HTML in WordPress plugins.

AuthorLonsdale201
Version1.0.0
Installs0

System Documentation

What problem does it solve?

WordPress plugins and themes rely on HTML parsing and manipulation. Using regex, DOMDocument, or ad-hoc escaping can lead to broken markup and security risks. This skill provides safe server-side HTML inspection and mutation using WordPress' HTML API, guiding you to use WP_HTML_Tag_Processor and WP_HTML_Processor to modify HTML reliably and safely.

Core Features & Use Cases

  • Safe attribute and class mutations via WP_HTML_Tag_Processor
  • Structural HTML handling and token serialization with WP_HTML_Processor
  • Correct data-* attribute handling and awareness of WP 6.9 escaping behavior
  • Suitable for plugin code that reads or modifies rendered HTML, shortcodes, content filters, widget markup, or emails

Quick Start

Process a snippet of HTML with WP_HTML_Tag_Processor to add a class to all links.

Dependency Matrix

Required Modules

None required

Components

Standard package

💻 Claude Code Installation

Recommended: Let Claude install automatically. Simply copy and paste the text below to Claude Code.

Please help me install this Skill:
Name: wp-html-api
Download link: https://github.com/Lonsdale201/wp-agent-skills/archive/main.zip#wp-html-api

Please download this .zip file, extract it, and install it in the .claude/skills/ directory.
View Source Repository

Agent Skills Search Helper

Install a tiny helper to your Agent, search and equip skill from 471,000+ vetted skills library on demand.