wp-html-standards
Skill4 starsChanged 3 days agoMITView on GitHub
WordPress HTML Coding Standards reference — W3C validation, self-closing elements, attribute quoting, lowercase tags, tabs indentation, PHP and HTML mixing. Use when writing or reviewing theme templates, markup in PHP files, or when asked about WordPress HTML conventions. Pairs with wp-css-standards and wp-js-standards.
In this repository44 other files it gives its agents.
- AGENTS.mdAGENTS.md
- diagnosing-bugsSkill
- domain-modelingSkill
- fixSkill
- frontend-designSkill
- grill-meSkill
- grill-with-docsSkill
- gsap-coreSkill
- gsap-performanceSkill
- gsap-pluginsSkill
- gsap-scrolltriggerSkill
- gsap-timelineSkill
- gsap-utilsSkill
- handoffSkill
- landing-page-conversion-auditSkill
- refactorSkill
- researchSkill
- reviewSkill
- share-learningSkill
- tddSkill
- threejs-animationSkill
- threejs-fundamentalsSkill
- threejs-geometrySkill
- threejs-interactionSkill
- threejs-lightingSkill
- threejs-loadersSkill
- threejs-materialsSkill
- threejs-postprocessingSkill
- threejs-shadersSkill
- threejs-texturesSkill
- to-specSkill
- to-ticketsSkill
- verifySkill
- wp-accessibilitySkill
- wp-accessibility-standardsSkill
- wp-css-standardsSkill
- wp-github-actions-standardsSkill
- wp-i18nSkill
- wp-js-standardsSkill
- wp-performanceSkill
- wp-php-standardsSkill
- wp-pluginSkill
- wp-security-auditSkill
- wp-themeSkill
The file
We split this skill into the rules it gives an agent
6 rules. About 0 are common, 3 are distinctive, and 3 are very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
3
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 12
Write and review HTML that follows the WordPress HTML Coding Standards — valid, escaped, tab-indented markup that plays well with PHP …
- Distinctive: line 25
All pages verified against the W3C validator — well-formed markup catches automation-testable problems.
- Distinctive: line 34
All tags and attributes lowercase
- Very specific: line 41
Every attribute has a value, single or double quoted: <input type="text" name="email" disabled="disabled" />
- Very specific: line 73
Never write unescaped output in markup — every dynamic value passes through the escaping matrix (esc_html/esc_attr/esc_url/wp_kses_post)
- Very specific: line 76
Keep markup valid even without JS (content usable <noscript>)
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
WordPress HTML Coding Standards
Distilled from the official WordPress HTML Coding Standards (developer.wordpress.org).
Goal
Write and review HTML that follows the WordPress HTML Coding Standards — valid, escaped, tab-indented markup that plays well with PHP templates.
When to use
- Writing or reviewing template markup in theme/plugin PHP files
- Reviewing rendered HTML for standard compliance
- Answering "what does the WordPress HTML standard say about X"
The standard
Validation
- All pages verified against the W3C validator — well-formed markup catches automation-testable problems; not a substitute for manual review
Self-closing elements
- Forward slash with exactly one space before it:
<br />— never<br/>
Attributes and tags
- All tags and attributes lowercase
- Attribute values lowercase when machine-interpreted (
content-type); proper title capitalization for human-readable data (link titles) - Attributes always quoted (unquoted attributes are a security vulnerability)
Quotes
- Every attribute has a value, single or double quoted:
<input type="text" name="email" disabled="disabled" /> - Boolean attributes: value omitted —
disabled, neverdisabled="true"(true/falseare invalid on boolean attributes)
Indentation
- Tabs, not spaces; indentation reflects logical structure
- Mixing PHP and HTML: indent PHP blocks to match surrounding HTML; closing PHP blocks at the same indentation as opening
<?php if ( ! have_posts() ) : ?>
<div id="post-1" class="post">
<h1 class="entry-title">Not Found</h1>
<?php get_search_form(); ?>
</div>
<?php endif; ?>Enforcement mapping
| Rule | Enforced by |
| Tabs, quoting, trailing whitespace | Prettier HTML (useTabs: true) |
| Mixed PHP/HTML indentation, embedded PHP tag layout | WPCS Squiz.PHP.EmbeddedPhp (via phpcs) |
| Lowercase tags/attributes | Prettier HTML (normalizes) |
| W3C validation | Review + validator (no automated gate) |
| Escaping of dynamic output | WPCS WordPress.Security.EscapeOutput (esc_html/esc_attr/esc_url at output) |
Rules
- Never write unescaped output in markup — every dynamic value passes through the
escaping matrix (
esc_html/esc_attr/esc_url/wp_kses_post) - Boolean attributes without values; self-closing with the space
- Keep markup valid even without JS (content usable
<noscript>)
Output contract
- Templates written: valid HTML5, tabs, all output escaped at echo time
- Review findings:
file:line+ violated rule + fix
References
- HTML Coding Standards — official
- Internal: wp-php-standards (escaping + template rules) · wp-css-standards · front-end stack
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

