GeneratePress
These abilities register when GeneratePress is detected on the site and a Pro licence is active. If either is missing the module stays absent rather than failing at call time.
At a glance
GeneratePress registers 23 abilities: 14 that only read, 0 that write, and 9 marked destructive. That split is the practical answer to how much of this module can run unattended. Reads cost nothing and are safe to repeat, so discovery is the part to be generous with; the writes are where review belongs, and the destructive calls stop for an explicit confirmation every single time regardless of which profile is active.
What this module is for
Manage GeneratePress settings, modules, Elements, conditions, hooks, fonts, layouts, Customizer schemas, and site-library workflows through WPPilot Pro.
Before you rely on it: Snapshot settings before applying or restoring a library site, and audit every Element condition.
Typical workflows
- Inspect Element conditions before editing a hook
- Apply a site-library design with a restoration plan
- Add a font and align it with theme settings
The GeneratePress integration page covers the same module from the workflow side, with the capability map and the questions worth asking before a first write.
Availability on your site
The GeneratePress module needs three things at once: WPPilot Free as the MCP foundation, an active Pro licence, and the companion plugin detected on the site. Miss any one and the module does not register, which is deliberate: an ability that appears in the tool list but fails at call time is worse than an ability that was never offered. What the connected agent can actually call is then narrowed twice more: by the safety profile active on the site, and by the WordPress capabilities of the user behind the credential. A read that succeeds for an administrator can be absent entirely for an editor.
Every write these abilities perform is recorded in the change ledger, and destructive calls can be routed through the approval queue so a person signs off before anything is applied. A successful tool result means the operation returned, not that the front end, the cache, and every dependent template are correct: that still needs a look.
Reads
Available in every safety profile, including Read Only. Inspection costs nothing and is not rate limited.
| Ability | What it does |
|---|---|
wppilot/generatepress-check-setupCheck GeneratePress Setup | Diagnostic snapshot of the GeneratePress install: theme active flag + version + minimum supported, GP Premium presence + version, the activation flag for every Premium module the integration cares about (elements, site_library, font_library, backgrounds, blog, colors, typography, spacing, copyright, disable_elements, menu_plus, secondary_nav, woocommerce), and the GenerateBlocks (free + Pro) presence + version. Call once at the start of any session that will read or write theme settings, Elements, or build page content. Lean by design — does NOT echo the settings or hook list back; use code-snippets-style drill-down (generatepress-get-settings, generatepress-list-hooks). |
wppilot/generatepress-get-css-outputGet GeneratePress Dynamic CSS | Returns the CSS strings GeneratePress builds at runtime from generate_settings and (when active) the Font Library. Useful for debugging why a style choice is not landing on the front-end. Five streams: base (theme container / colour variables — generate_base_css), typography (font-family / size / weight rules — generate_typography_default_styles), spacing (container / element spacing — generate_spacing_css), advanced (top bar / secondary nav / mobile menu — generate_advanced_css), and font_library (the dynamic @font-face rules from GP Premium's Font Library, empty string when the module is off). The combined output mirrors the inline <style id="generate-style-inline-css"> block on the front-end, minus the small generate_no_cache_dynamic_css fragment that GP injects at enqueue time. |
wppilot/generatepress-get-customizer-schemaGet Customizer Schema (GeneratePress) | Returns the GeneratePress + GP Premium sections + controls registered in the WordPress Customizer. Each section is {id, title, panel, priority} and each control is {id, setting, label, type, choices, section, priority}. Reference for generatepress-set-settings — the setting field of each control is the key you would pass inside the settings patch (controls bound to generate_settings[<key>] map to the simple <key> form set-settings accepts). Use scope=gp_only (default) to keep the response to GeneratePress-owned entries (theme + Premium), scope=all to include core WP and other plugins. |
wppilot/generatepress-get-defaultsGet GeneratePress Defaults | Returns the four default sets that compose GeneratePress's known settings surface: settings (layout / structural — generate_get_defaults), colors (palette — generate_get_color_defaults), typography (font stack — generate_get_default_fonts), spacing (padding / margins — generate_spacing_get_defaults). Use as a schema reference before calling generatepress-set-settings — the value type per key follows the default value's type (int / string / bool / array). |
wppilot/generatepress-get-elementGet GeneratePress Element | Reads a single gp_elements post by id with every meta key the integration cares about decoded into a flat object: id, title, status, type, block_type, content, hook (+ custom_hook if hook="custom"), priority, execute_shortcodes, disable_site_header / _footer, display_conditions, exclude_conditions, user_conditions. The _generate_hook_execute_php meta is INTENTIONALLY OMITTED — exposing arbitrary PHP execution to AI agents is a code-injection vector we never want; a human site-owner sets it via the metabox UI. Returns WP_Error when the id does not exist or points at a non-gp_elements post. |
wppilot/generatepress-get-layoutGet GeneratePress Layout | Resolves the layout decisions GeneratePress would make for the current request context (or for a specific post if post_id is passed). Returns sidebar layout, navigation location, footer-widgets count, and the flexbox-engine flag. Use this when reasoning about where to place hook elements or block elements — the values reflect the cascade of theme settings + per-post overrides + filters, which is hard to compute by hand. Read-only — does NOT mutate state even when post_id is supplied. |
wppilot/generatepress-get-settingsGet GeneratePress Settings | Reads keys from the generate_settings option array (e.g. container_width, layout_setting, header_layout_setting, primary_nav_position_setting, colors, fonts). Use keys to pull only what you need — leaving it empty returns the FULL set (heavy: ~80 keys on a default install, more with Premium modules). Reads go through the theme's canonical accessor generate_get_option() so defaults + the generate_option filter are applied — never reads get_option('generate_settings') raw. To see what keys exist without reading values, call generatepress-get-defaults. |
wppilot/generatepress-get-siteGet GeneratePress Site Library Template | Returns the full record for a single starter template plus a probe of which remote assets (options.json, content.xml, widgets.wie) are present at the template directory. The asset-presence flags tell you which steps generatepress-apply-site can actually run — for example, a template without widgets.wie will silently skip the widgets step. Use the plugins map to know what activate_plugins would attempt before running an apply with steps=["plugins"]. |
wppilot/generatepress-list-element-conditionsList GeneratePress Element Conditions | Returns the catalogue of conditions a GP Premium Element can use to scope visibility. Two buckets: display_exclude (used by both display_conditions and exclude_conditions on an element — same vocabulary) and user (used by user_conditions). Each entry is a {group, label, locations: {<rule-key>: <label>}} row sourced from GeneratePress_Conditions::get_conditions() and ::get_user_conditions() — the same classes the admin UI uses. Pass this catalogue to the agent before composing a payload for generatepress-set-element-conditions so the rule values it picks exist. |
wppilot/generatepress-list-elementsList GeneratePress Elements | Lists gp_elements posts (Hook Elements + Block Elements + headers + layouts) as a compact summary per element — id, title, status, type, block_type, hook, priority, modified, and per-bucket conditions counts. The content body is intentionally omitted (can be long raw HTML / shortcode) — drill down via generatepress-get-element for a specific id. Filters compose: type, block_type, status, hook, limit. |
wppilot/generatepress-list-fontsList GeneratePress Fonts | Lists the fonts the GP Premium Font Library has bundled (Google Fonts downloaded locally + custom uploads). Each row carries {id, name, slug, fontFamily, alias, variants, source, fallback, fontDisplay, preview, cssVariable, disabled}. Notable: cssVariable is the CSS custom-property name (e.g. --gp-font--inter) you reference in generate_settings.font_body / font_headings; disabled=true means the post is not in publish status; source may be "" when GP Premium did not record a provenance (most Google downloads in 2.5.x leave it blank — fall back to per-variant source inside variants to know if a row came from Google CDN vs custom upload). |
wppilot/generatepress-list-hooksList GeneratePress Hooks | Lists the GeneratePress action hooks available as injection points for Hook Elements (Group B). When GP Premium Elements is active the catalogue comes from GeneratePress_Elements_Helper::get_available_hooks() — the same list the admin UI uses, grouped by area (header, navigation, content, footer, woocommerce, …). When Elements is not active the response falls back to a small set of the core theme hooks an agent might still find useful as a reference. Use group to narrow the response. |
wppilot/generatepress-list-modulesList GP Premium Modules | Reports every GP Premium module known to the integration (Backgrounds, Blog, Colors, Copyright, Disable Elements, Elements, Hooks, Menu Plus, Page Header, Secondary Nav, Sections, Spacing, Typography, WooCommerce, Site Library, Font Library — 16 total in GP Premium 2.5.x). Each row contains {slug, label, active, source} — source explains WHY the module is active: option (the generate_package_<name> option equals "activated"), constant (the GENERATE_<NAME> constant is defined in wp-config or mu-plugin), or none (inactive). Use this when generatepress-check-setup's gp_premium.modules map is too terse — list-modules gives the per-module signal source. |
wppilot/generatepress-list-sitesList GeneratePress Site Library Templates | Returns the catalogue of starter templates the GP Premium Site Library can install. The list is cached in the generatepress_sites option (1-day TTL); pass refresh=true to force a fresh fetch from gpsites.co (network call). Each row is a compact summary — name, category, description, page_builder, preview_url, min_theme_version, plugins map, directory (the remote asset root used by generatepress-apply-site). Use generatepress-get-site to inspect a specific template before applying. |
Destructive
Marked destructive in the source, so each call needs an explicit confirmation flag, every time.
| Ability | What it does |
|---|---|
wppilot/generatepress-add-fontAdd Google Font to GeneratePress Library | Downloads a Google Font into the local GP Premium Font Library and creates the matching gp_font post. Side effects: woff2/woff files written under wp-content/uploads/generatepress/fonts/<slug>/, post created with the variants meta filled in, fonts.css regenerated. Idempotent on family — calling twice with the same family + variants tops up missing variants but does not duplicate the post. Use generatepress-list-fonts after to confirm the cssVariable assigned. Each variant string follows the Google Fonts notation (400, 400italic, 700, 700italic). |
wppilot/generatepress-apply-siteApply GeneratePress Site Library Template | DESTRUCTIVE — overwrites Customizer settings, imports posts/pages/media, sets element locations, and (optionally) installs/activates plugins from a Site Library starter template. Steps run in fixed order: theme_options → plugins → content → site_options → widgets. The default step list excludes plugins because plugin installation is the riskiest path; pass steps=["theme_options","plugins","content","site_options","widgets"] to opt in. confirm=true is required — the call returns a gp_confirmation_required WP_Error otherwise. Use generatepress-get-site first to know which assets are present (a step whose asset is missing fails fast and is recorded under steps_failed). Rollback is partial: restore_theme_options and restore_content exist in the WP admin Site Library panel but are not exposed via abilities yet. |
wppilot/generatepress-create-elementCreate GeneratePress Element | Creates a new gp_elements post. Required inputs depend on type: every element needs title + type; when type=block, block_type is required; when type=hook (or type=block with block_type=hook), hook is required (or hook="custom" plus custom_hook for a non-registered action). content is treated as a raw string (HTML / shortcode / Gutenberg block-serialised markup); the integration does NOT parse it. The _generate_hook_execute_php flag is permanently blocked — agents do not write arbitrary PHP via this ability. New elements default to status=publish. Use generatepress-list-hooks before this call so the hook value is valid. |
wppilot/generatepress-delete-elementDelete GeneratePress Element | Removes a gp_elements post. Default behaviour: send it to the trash (recoverable from the WP admin trash bin). Pass force=true to hard-delete (irrecoverable via the abilities). Use the trash-then-restore flow whenever possible — the user can recover the element from /wp-admin/edit.php?post_type=gp_elements&post_status=trash without a database backup. Returns WP_Error when the id is not a gp_elements post. |
wppilot/generatepress-delete-fontDelete GeneratePress Font | Permanently removes a font from the GP Premium Font Library. Hard delete — the gp_font post is force-deleted, the per-font upload directory (wp-content/uploads/generatepress/fonts/<slug>/) is recursively wiped, and the bundled fonts.css is regenerated. No trash flow exists for this CPT — there is no undo. Before calling, run generatepress-list-fonts to confirm the id, and check that generate_settings.font_body / font_headings do not reference the font being removed (the front-end will silently fall back to a system font otherwise). |
wppilot/generatepress-edit-elementEdit GeneratePress Element | Patches an existing gp_elements post. Merge semantics: only the keys you pass are updated, omitted keys keep their current value. When changing type (or moving type=block between block_type values), pass both fields together — the integration validates the resulting combination. Conditions (display / exclude / user) are NOT touched by this ability; use generatepress-set-element-conditions for those. The _generate_hook_execute_php flag is permanently blocked. Returns WP_Error when the id does not point at a gp_elements post. |
wppilot/generatepress-restore-siteRestore GeneratePress Site Library Backup | Undo for generatepress-apply-site. GP Premium snapshots theme_options (Customizer settings + theme mods + active modules) and content (post / term ids imported during an apply) into a single _generatepress_site_library_backup option at apply time. This ability dispatches the matching REST restore endpoint(s): target=theme_options reverts Customizer / theme_mods / module activation (backup option preserved — safe to re-run); target=content deletes the posts and terms imported by the last apply AND removes the backup option (single-use — a second call returns gp_no_backup); target=all (default) runs both, leaving no backup. confirm=true is required. Returns gp_no_backup WP_Error when no apply has run yet or the backup was already consumed. |
wppilot/generatepress-set-element-conditionsSet GeneratePress Element Conditions | Writes the display / exclude / user conditions onto an existing gp_elements post. Each condition is {rule: "<group>:<key>", object?: "<id-or-empty>"} — the storage shape the plugin's metabox uses (class-metabox.php:1900-1935). Pass the buckets you want to update; omitted buckets keep their current value. Pass [] (empty array) to clear a bucket. Always validate rule values against the catalogue from generatepress-list-element-conditions first — bad rules are stored as-is and silently never match. |
wppilot/generatepress-set-settingsSet GeneratePress Settings | Patches the generate_settings option array — merge semantics, only the keys present in settings are touched, omitted keys keep their current value. Keys unknown to generate_get_defaults() (and the color / font / spacing default sets) are written anyway but surface in the warnings field of the response — this preserves the ability to set keys added by GP Premium modules or child themes (via the generate_option_defaults filter) that an agent might not see in the static defaults reference. The write is destructive (overwrites prior values for the listed keys); pair with generatepress-get-settings to read existing values before patching. |