Skip to content
FieldGrade
← Back to Home
guide

Fix Orphaned affiliateProducts Frontmatter

5 min readBy FieldGrade Team

Fix Orphaned affiliateProducts Frontmatter

CONCLUSIONS:

  • Articles with affiliateProducts: [] but containing /go/ links have inconsistent frontmatter.
  • These articles require updating affiliateProducts to include the actual product IDs from the links for accurate affiliate tracking.

SUPPORTING DETAIL:

  1. Audit Scope: Scan all fieldgrade articles for affiliateProducts: [] and search body content for /go/ links.
  2. Mapping Logic: Extract product IDs from /go/ URLs (e.g., /go/1234512345) and populate affiliateProducts array.
  3. Validation: Ensure updated affiliateProducts matches all inline links in the article body.
  4. Edge Cases: If an article has no /go/ links, retain affiliateProducts: [] to avoid false positives.