Skip to content

Using AI Assistants with Woody Code Snippets ​

You can connect an AI assistant to inspect your Woody snippets. If you explicitly allow write access, it can also create or update snippets and change their activation state.

In this article

Before You Start ​

Install an AI connector that exposes WordPress abilities (actions a plugin makes available to connected assistants). For example, follow the Easy MCP AI getting started guide to connect your assistant to your WordPress site.

The connected WordPress user must have administrator-level permission to manage Woody snippets and permission to edit the snippet post type. Creating a snippet also requires permission to create snippets; reading the code of, updating, or activating an existing snippet requires permission to edit that particular snippet. Connecting an assistant does not bypass the permissions used by Woody's snippet editor.

Enable Woody Abilities in Easy MCP AI ​

  1. In Easy MCP AI, go to Easy MCP AI > Tools > Abilities.
  2. Find and expand the Woody category.
  3. Turn on the read abilities if you want your assistant to inspect snippets.
  4. Turn on either write ability only when you want the assistant to change or activate snippets, then click Save changes in Easy MCP AI.

AbilityWhat it doesAI Connect enable flow
woody/list-snippetsFinds snippets and returns their type, scope, insertion location, status, and activation state without returning code.Included
woody/get-snippetReads one snippet, including its code and display conditions.Included
woody/upsert-snippetCreates an inactive snippet or updates supported code and execution settings.Disabled until explicitly enabled
woody/set-snippet-stateActivates or deactivates a snippet.Disabled until explicitly enabled

Here, “settings” means a snippet's execution settings, such as Snippet Scope, Location, display conditions, description, and activation state. These abilities do not change Woody's global plugin settings.

Safety Behavior ​

  • New snippets created through the AI ability start inactive.
  • Changes to automatically running PHP and Universal code are evaluated for errors before saving, unless safe mode prevents evaluation. Ask for a dry_run to check a proposed change without saving it; code that fails an available check is rejected. A successful check does not guarantee that code is safe.
  • Activating a snippet uses the same error checks as the activation switch in Woody's snippet list.
  • CSS and JavaScript snippet code cannot be written through the AI ability; save those changes in Woody's snippet editor instead.
  • Premium display-condition parameters can only be saved when Woody Code Snippets Premium is installed.

Creating, updating, or activating a snippet can execute code that affects your site. Review proposed code before allowing changes or activating a snippet, and leave write abilities disabled when you do not need them.

Example Prompts ​

  • “Which active Woody snippets run PHP on every page?”
  • “Find the snippet that loads gtag and tell me where it is inserted.”
  • “Show me the code of my header scripts snippet and explain it without changing anything.”
  • “Validate this PHP change with a dry run, but do not save or activate it.”
Was this helpful?