CMS & content · guide

Custom post types

Model any structured content — products, listings, case studies — without a plugin.

Custom post types

Custom post types (CPTs) let you model any content shape beyond built-in Pages and Posts. Everything CPT UI + ACF gives WordPress is native in WordSafe.

Create a post type

  1. Content → Post types → New post type.
  2. Fill in:
    • Singular / plural labels (e.g. Product / Products)
    • Slug — used in URLs (/products/blue-widget)
    • Icon — pick from the Lucide set
    • Supports — title, editor, featured image, excerpt, revisions, custom fields
    • Public / Show in menu / Show in REST — visibility toggles
  3. Save. A new sidebar item appears in Content.

Taxonomies

Add categories and tags — or fully custom taxonomies (e.g. Brand, Region) — under Content → Taxonomies. Attach a taxonomy to one or more post types.

Archive and single templates

Each CPT ships with a default archive (/products) and single (/products/:slug) template. Override either by creating:

  • templates/archive-<slug>.tsx
  • templates/single-<slug>.tsx

Or design them visually in the Builder and assign under Design → Template hierarchy.

Querying from code

import { getPosts } from "@wordsafe/sdk";
const products = await getPosts({ type: "product", limit: 20, orderBy: "date" });

See the Content API reference.