Skip to main content

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​

FieldKeyTypeRequiredDescription
Content Typecontent_typeCheckbox (max 1)YesHub, Pillar, Cluster, or Supporting
Hubhub_parentPost Object (page)NoHub page this article belongs to
Pillarpillar_parentPost Object (post)Yes (if not Pillar)Related pillar post
Clustercluster_parentPost Object (post)NoCluster post under the pillar
Primary Keywordprimary_keywordTextNoMain SEO keyword
Semantic Tagssemantic_tagsTextNoComma-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​

TypeRole
HubTop-level topic hub page
PillarComprehensive pillar article (doesn't require pillar_parent)
ClusterSupporting article within a pillar
SupportingSupplementary 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.