WPW SEO Architecture
Overview
Version 0.1.3 by wpwhite.com. Registers an ACF field group (group_seo_architecture) in the post editor sidebar that tracks content hierarchy and SEO relationships.
Field Group
| Field | Key | Type | Required | Description |
|---|---|---|---|---|
| Content Type | content_type | Checkbox (max 1) | Yes | Hub, Pillar, Cluster, or Supporting |
| Hub | hub_parent | Post Object (page) | No | Hub page this article belongs to |
| Pillar | pillar_parent | Post Object (post) | Yes (if not Pillar) | Related pillar post |
| Cluster | cluster_parent | Post Object (post) | No | Cluster post under the pillar |
| Primary Keyword | primary_keyword | Text | No | Main SEO keyword |
| Semantic Tags | semantic_tags | Text | No | Comma-separated semantic concepts |
Validation Rules
Content Type (required)
if (empty($value)) {
return 'Content Type is required. Select one SEO architecture role: Hub, Pillar, Cluster, or Supporting.';
}
Pillar Parent (conditional)
Pillar parent is required unless the post itself is set as the Pillar content type:
if (empty($value) && !is_pillar_content_type_selected()) {
return 'Pillar is required for Hub, Cluster, and Supporting posts.';
}
Content Types
| Type | Role |
|---|---|
| Hub | Top-level topic hub page |
| Pillar | Comprehensive pillar article (doesn't require pillar_parent) |
| Cluster | Supporting article within a pillar |
| Supporting | Supplementary content |
Metabox Locking
The SEO Architecture metabox is programmatically locked to the sidebar position using user meta (meta-box-order_post). A MutationObserver in the admin footer ensures it stays in the sidebar even if users try to drag it elsewhere.
Validation Notice Helper
The admin footer script also enhances validation error notices by appending a helpful explanation when SEO Architecture validation fails.
Field Group Location
Applied to all posts (post_type == 'post').
ACF Export
Defined via acf_add_local_field_group(), meaning it's registered in code rather than imported via ACF's UI JSON export.