WP CLI Scripts

WP Rig (as of version 3) comes with some WP CLI scripts to help the theme developer workflow. Below is a list of all of scripts, what they do, and how to use them.

wp rig dev_setup

This script is designed for devs that are getting up and running with a new project to help them quickly scaffold their local dev env with a curated set of WP plugins we feel would be helpful during theme development. It also configures essential WordPress pages and settings for a static front page setup.

These plugins include:

  • FakerPress
    • FakerPress is a plugin designed to generate dummy content for WordPress sites. This is useful for theme developers as it helps populate a site with posts, pages, users, and other data to test how themes handle different types of content and layouts. It enables developers to simulate real-world scenarios and catch design or functionality issues before launching the theme.
  • Theme Check
    • Theme Check is a plugin that allows developers to test their themes against WordPress coding standards and best practices. It runs automated tests to identify issues such as deprecated functions, improper use of hooks, or missing features. This helps theme developers ensure their themes meet the requirements for inclusion in the WordPress.org repository and follow industry standards.
  • Query Monitor
    • Query Monitor is a debugging plugin that provides insights into database queries, hooks, PHP errors, and more. For theme developers, it is particularly helpful in identifying inefficient database queries or problematic code in templates. It aids in optimizing theme performance and troubleshooting issues related to theme development.
  • Accessibility Checker
    • Accessibility Checker scans websites for accessibility issues and provides reports based on WCAG guidelines. It enables theme developers to identify and fix design and structural problems, ensuring their themes are inclusive and accessible to all users.
  • Auto Description
    • Auto Description automatically generates meta descriptions for posts and pages based on their content, improving SEO. For theme developers, it ensures that themes properly support dynamic meta descriptions and display them correctly in the site’s markup.

This script also creates a “Home” page with welcome content, a “Blog” page for posts, and configures WordPress to use a static front page setup.

This list of plugins is subject to change in the future. If you feel any of these plugins are problematic or feel there are other plugins that should be on this list, please share your thoughts with us.

WP Rig includes a suite of commands for generating, exporting, importing, and listing navigation menus. These are invaluable for developers testing theme navigation components, syncing menus across environments, or rapidly prototyping menu structures without manual admin intervention.

wp rig fake_menu_items

This command generates dummy navigation menu items with hierarchical structure, perfect for populating menus during theme development and testing responsive behaviors, accessibility, or custom walker implementations. It intelligently creates or appends to existing menus, with options for depth, item counts, and naming prefixes. All items use “#” as placeholder links, and deeper levels have fewer items to keep the structure manageable.

OptionDescriptionDefault
--menu=<menu>Menu name or ID to add items to. Creates new menu if not providedCreates new menu
--items=<number>Number of top-level menu items to create5
--depth=<number>Maximum depth of submenu items (1-3)2
--subitems=<number>Number of subitems per parent3
--prefix=<text>Prefix for menu item names“Menu Item”
--assign-location=<location>Assign menu to a theme location after creationNone

Usage: wp rig fake_menu_items [options]

Examples:

# Create a basic menu with default settings
wp rig fake_menu_items
# Create 8 top-level items with 4 subitems each, 3 levels deep
wp rig fake_menu_items --menu="Test Menu" --items=8 --subitems=4 --depth=3
# Create a menu and assign it to the primary location
wp rig fake_menu_items --items=6 --depth=2 --prefix="Nav Item" --assign-location=primary
# Create items in an existing menu
wp rig fake_menu_items --menu="Main Navigation" --items=10 --prefix="Page"

wp rig menu_export

This command exports a specified WordPress navigation menu to JSON format, capturing the full structure including items, hierarchy, metadata, and associations. Developers can use this for backing up complex menu configurations, sharing across team members, or migrating between development/staging/production sites without losing customizations.

OptionDescriptionDefault
<menu_name>The name of the menu to exportRequired
--file=<filename>Save to a specific fileOutputs to stdout if not provided
--prettyFormat JSON with indentation for better readabilityCompact JSON

Usage: wp rig menu_export <menu_name> [--file=<filename>] [--pretty]

Examples:

# Export menu to stdout
wp rig menu_export "Main Menu"
# Export menu to a file
wp rig menu_export "Main Menu" --file=main-menu.json
# Export menu to a file with formatted JSON
wp rig menu_export "Main Menu" --file=main-menu.json --pretty

wp rig menu_import

The counterpart to menu_export, this command imports a JSON menu file into WordPress, recreating the structure, items, and metadata exactly. It’s essential for restoring menus after database migrations or when handing off theme prototypes. Supports dry-run mode for safe testing and overwrite options to handle conflicts gracefully.

OptionDescriptionDefault
<file>Path to the JSON file containing menu dataRequired
--overwriteOverwrite existing menu with the same nameError if menu exists
--dry-runTest the import without making changesFalse

Usage: wp rig menu_import <file> [--overwrite] [--dry-run]

Examples:

# Import menu from file
wp rig menu_import main-menu.json
# Import menu and overwrite any existing menu with the same name
wp rig menu_import main-menu.json --overwrite
# Test import without making changes
wp rig menu_import main-menu.json --dry-run

wp rig menu_list

A quick utility to list all registered navigation menus in your WordPress install, with output formats suitable for scripting or quick reference. Helps developers inventory menus before export/import operations or when debugging theme location assignments.

OptionDescriptionDefault
--format=<format>Output format (table, csv, json, yaml)table

Usage: wp rig menu_list [--format=<format>]

Examples:

# List all menus in table format
wp rig menu_list
# List all menus in JSON format
wp rig menu_list --format=json

Font Management

wp rig fonts_download

This command downloads Google Fonts declared in your theme’s Fonts Component and saves them locally within the active theme directory. By serving fonts from your own assets instead of the Google Fonts CDN, developers gain better control over performance, privacy (e.g., GDPR compliance), and reliability. It generates optimized .woff2 files in subfolders and a corresponding CSS file with @font-face declarations using local paths.

OptionDescriptionDefault
--dir=<dir>Relative directory within the active theme where fonts and the generated CSS will be storedassets/fonts

Usage: wp rig fonts_download [--dir=<dir>]

Examples:

# Download fonts to the default directory
wp rig fonts_download
# Download fonts to a custom directory
wp rig fonts_download --dir=assets/fonts

What it does:

  • Reads the Google Fonts families declared in the theme’s Fonts Component
  • Downloads the corresponding .woff2 files into subfolders under the destination directory
  • Generates a google-fonts.css file with local URLs pointing to the downloaded assets
  • Prints the path to the generated CSS on success

These commands require WP-CLI installed and execution from the WordPress root directory, with appropriate permissions for plugin installation and menu management. For full options, run wp help rig <command>. If you have suggestions for additional scripts, open a discussion on GitHub.