Skip to main content

wp scaffold theme

Overview

Generate a full standalone WordPress theme from scratch. The scaffold creates style.css, functions.php, index.php, header.php, footer.php, sidebar.php, and more — all wired together and ready to customise.

What It Does

wp scaffold theme creates a correctly structured blank theme in wp-content/themes/ that follows WordPress template hierarchy conventions. Optionally adds unit test scaffolding and activates immediately.

Syntax

wp scaffold theme <slug> [OPTIONS]

Options

FlagDescription
SLUGTheme directory name
--theme_name=NAMEHuman-readable theme name
--author=NAMEAuthor name
--author_uri=URLAuthor URL
--activateActivate after creation
--forceOverwrite existing

Basic Usage

wp scaffold theme my-custom-theme \
--theme_name="My Custom Theme" \
--author="Jane Doe" \
--activate

Output:

Success: Created theme files.
Activating 'my-custom-theme'...
Success: Switched to 'my-custom-theme' theme.

Generated File Structure

wp-content/themes/my-custom-theme/
├── style.css
├── functions.php
├── index.php
├── header.php
├── footer.php
├── sidebar.php
├── page.php
├── single.php
├── archive.php
├── search.php
├── 404.php
└── screenshot.png

Best Practices

  1. Use for completely custom themes — if inheriting from an existing theme, use wp scaffold child-theme instead.
  2. Activate immediately with --activate to confirm the theme loads without errors.
  3. Commit the scaffold files to git before making any modifications.

Quick Reference

wp scaffold theme <slug> --theme_name=<name> --activate

Next Steps