Use Case

Generate Blog and CMS Test Data with MockHero

The Problem

Building a blog or CMS requires data to test layouts, pagination, search, and category filtering. A handful of "Lorem ipsum" posts with identical authors tells you nothing about how your design handles long titles, short excerpts, or posts with dozens of comments.

Most blog seed scripts hardcode three posts and call it done. Then in production, the first real post with a long title breaks the card layout.

The Solution: MockHero API

MockHero generates realistic blog content with proper relationships between authors, posts, categories, and comments. Use the built-in blog template or define a custom schema for full control.

Quick Setup

curl -X POST https://api.mockhero.dev/api/v1/generate \
  -H "x-api-key: mh_your_api_key" \
  -H "Content-Type: application/json" \
  -d '{
  "template": "blog",
  "scale": 2,
  "format": "json"
}'

Step-by-Step Guide

1. Use the blog template

The blog template generates authors, categories, posts, and comments out of the box.

2. Get your MockHero API key

Sign up at mockhero.dev/sign-up.

3. Custom schema for more control

Define tables for authors, posts (with slug, excerpt, body, category fields), and comments linked through ref fields.

4. Insert into your CMS database

Use the returned JSON with your preferred database driver or ORM.

5. Test your blog UI

Browse the post listing page, open individual posts, check comments, and test category filtering with real data.

Complete Example

The template gives you instant data. The custom schema lets you match your exact CMS model. Both approaches produce data with valid cross-table references.

Why MockHero vs Faker / Manual Seeds

  • Blog template — one line for a complete blog dataset.
  • Realistic content — titles, excerpts, and body text that actually read well.
  • Comment threading — easily extend the schema to support nested comments with self-referencing ref fields.

Get Started

Free tier, no credit card. Sign up at mockhero.dev and fill your blog with realistic content in seconds.

M

MockHero Team

Guides and tutorials for generating realistic test data with the MockHero API.

Start generating test data for free

1,000 rows/month on the free tier. No credit card required.

Get Your API Key

Related Articles