Products
Solutions
Pricing
Compare
Resources
Developers
Support
LemonX Developers · Hooks & Filters

Customize LemonX the WordPress way.

LemonX is designed to be extended through WordPress-native developer patterns. Hooks and filters let you adjust workflows, modify output, connect custom logic and integrate site-specific behavior without hacking core product files.

Use extension points to modify generated content, customize Schema, control translation behavior, extend MCP tools, adapt Pro licensing logic and build agency-specific workflows that fit your WordPress environment.

WordPress-native · add_filter & add_action · Product-aware · Safe extension patterns

What are LemonX hooks and filters?

Hooks and filters are WordPress extension points that LemonX modules use throughout AEO, Code, Verto, MCP, Pro and shared services. They let developers change values, register custom behavior and respond to lifecycle events while keeping LemonX updatable.

If you are building client-specific logic, plugin compatibility layers or agency standards across many sites, hooks are usually the most natural place to start — especially when the customization should run inside WordPress rather than through an external app.

WordPress-native extensibility

LemonX exposes extension points through standard WordPress actions and filters so developers can customize behavior without editing core plugin files.

Product-aware hook groups

Hooks are organized around LemonX modules — AEO, Code, Verto, MCP, Pro and shared utilities — so you can extend only the workflows you need.

Safe customization patterns

Use filters to modify values, use actions to respond to lifecycle events, validate permissions in callbacks and keep custom logic isolated in your own plugin or mu-plugin.

Works with REST API and MCP

Hooks complement REST API integrations and MCP tool workflows. Use hooks for in-process WordPress customization; use REST and MCP for external systems and AI agents.

Filters vs actions

Know when to modify a value vs trigger a side effect.

Filters

Filters receive a value, let you modify it and must return the updated value. Use filters when LemonX produces output, configuration, lists or decisions that you want to customize.

  • Modify JSON-LD schema graphs before output
  • Add or restrict MCP tools in the registry
  • Change analyzable post types for AEO
  • Override Pro feature availability
  • Adjust AI prompt templates

Actions

Actions run at a specific point in a LemonX workflow. They do not return a modified value. Use actions when you want to trigger logging, sync external systems or run follow-up logic.

  • Respond when a Pro license changes state
  • Log or forward form submissions
  • Observe AI chat stream events
  • Trigger agency workflows after LemonX events
Extension surfaces

Hooks, REST API and MCP Tools solve different problems.

Hooks & Filters

  • Extend LemonX inside WordPress
  • Customize output and behavior
  • Add compatibility layers
  • Best for WP developers and agencies

REST API

  • Connect external apps and dashboards
  • Trigger workflows remotely
  • Pull reports and task status
  • Best for backend integrations

MCP Tools

  • Give AI agents structured capabilities
  • Preview and apply WordPress changes
  • Operate through chat clients
  • Best for AI agent workflows

Use hooks when customization should live inside WordPress. Use REST when external systems need programmatic access. Use MCP when AI agents need tool-driven WordPress operations.

Hook reference

Product-aware extension points across the LemonX Suite.

The hooks below are drawn from active LemonX plugin source and represent common developer extension points. Always confirm availability against your installed LemonX version and product entitlements.

MCP & AI Agent Hooks

Extend the LemonX MCP registry, resources, permissions and write policies. These hooks are central for agencies that want custom AI tools or stricter agent boundaries.

filter
lemonx_mcp_tools

Register or modify MCP tools available to connected AI clients.

$tools → array
filter
lemonx_mcp_resources

Add MCP resources readable by compatible clients.

$resources → array
filter
lemonx_mcp_resource_read

Customize resource payload when a URI is read.

$contents, $uri
filter
lemonx_mcp_allow_writes_without_pro

Control whether write tools can run without Pro entitlement.

bool → bool

Use Cases

  • Add a custom read-only audit tool for client sites
  • Expose internal documentation as MCP resources
  • Restrict write tools to senior editors
  • Register agency-specific AI workflows

LemonX Code & Frontend Hooks

Customize AI generation, frontend rendering, schema output, templates, fonts, Tailwind configuration and editor behavior for LemonX Code pages.

filter
lemonx_editor_output_jsonld

Enable or customize JSON-LD output for a page.

bool, $post_id → bool
filter
lemonx_editor_frontend_source

Modify rendered frontend HTML source for a page.

$source, $post_id → string
filter
lemonx_ai_prompt_templates

Add or override AI prompt templates used by LemonX Code.

$templates → array
filter
lemonx_tailwind_config

Customize Tailwind configuration for generated pages.

$config → array
filter
lemonx_code_require_pro

Control whether LemonX Code features require Pro.

bool → bool
action
lemonx_ai_chat_stream

Observe AI chat stream events for logging or analytics.

$scope, $image_count, $history_count
action
lemonx_form_submitted

Respond when a LemonX form receives a submission.

$form_id, $data, $entry_id

Use Cases

  • Inject custom schema for product landing pages
  • Adjust AI prompts for brand voice
  • Disable JSON-LD on specific templates
  • Sync form leads to a CRM on submission

LemonX AEO & SEO Hooks

Modify SEO metadata, schema graphs, analyzable content, social meta, indexing support and content used by AEO analysis workflows.

filter
lemonx_aeo_jsonld_graphs

Modify Schema.org graph output before it is rendered.

$graphs → array
filter
lemonx_aeo_analyzable_post_types

Control which post types AEO modules analyze.

$types → array
filter
lemonx_aeo_post_content

Modify post content before AEO analysis runs.

$content, $post → string
filter
lemonx_aeo_title_vars

Add variables available in SEO title templates.

$vars, $post → array
filter
lemonx_aeo_og_type

Customize Open Graph type for a post.

$type, $post → string
filter
lemonx_aeo_google_indexing_supported

Control whether Google indexing is offered for a post.

bool, $post → bool

Use Cases

  • Add custom schema for niche post types
  • Include custom fields in AEO analysis
  • Localize SEO title variables
  • Disable indexing for draft-like custom statuses

LemonX Verto Translation Hooks

Verto uses both lemonx_* integration hooks and lxt_* translation hooks. Use them to control translatable types, translation decisions, language switchers and provider behavior.

filter
lxt_translatable_post_types

Define which post types participate in translation workflows.

$types → array
filter
lxt_should_translate_object

Decide whether a specific field should be translated.

bool, $object_type, $object_id, … → bool
filter
lxt_switcher_languages

Modify languages shown in the frontend language switcher.

$langs, $current → array
filter
lxt_require_pro

Control whether Verto features require Pro entitlement.

bool → bool
filter
lemonx_aeo_translated_stored_schema

Control stored schema behavior for translated content.

bool, $post, $locale → bool

Use Cases

  • Exclude internal post types from translation
  • Skip translation for legal boilerplate fields
  • Reorder languages in the switcher
  • Apply locale-specific schema rules

LemonX Pro & Licensing Hooks

Customize entitlement checks, product lists, update channels, license lifecycle events and portal URLs for LemonX Pro deployments.

filter
lemonx_pro_feature_allowed

Allow or deny access to a Pro-gated feature.

bool, $feature, $entitlement → bool
filter
lemonx_pro_products

Modify the list of LemonX products exposed by Pro.

$products → array
filter
lemonx_pro_features

Modify feature flags available through Pro.

$features → array
filter
lemonx_pro_update_channel

Switch update channel between stable, beta or custom feeds.

$channel → string
action
lemonx_pro_license_changed

Run logic when license state changes.

$status, $entitlement

Use Cases

  • Grant agency-only features on client sites
  • Sync license changes to external billing
  • Use a custom update channel for staging
  • Expose custom product bundles in dashboards

Shared Utilities & Compatibility Hooks

Cross-cutting hooks for AI circuit breakers, HTTP safety, Shield integration, fonts, CDN behavior and other shared LemonX infrastructure.

filter
lemonx_ai_circuit_failure_threshold

Tune AI circuit breaker failure threshold.

int → int
filter
lemonx_allow_internal_http

Allow controlled internal HTTP requests when needed.

bool, $url → bool
filter
lemonx_self_host_fonts

Control self-hosted font behavior in LemonX Code.

bool → bool
filter
lemonx_shield_extra_header_hooks

Register extra Shield header injection points.

$hooks → array
filter
lemonx_editor_register_elementor_locations

Control Elementor location registration compatibility.

bool → bool

Use Cases

  • Tune AI reliability on high-traffic sites
  • Allow internal API calls in secure environments
  • Add Shield rules for custom templates
  • Disable Elementor integration when not needed
Common patterns

Start with these extension patterns.

Use lemonx_mcp_tools to append tools to the MCP registry. Keep tool definitions structured and permission-aware.

Modify schema graphs before LemonX outputs JSON-LD. Useful for ecommerce, local business or custom post type rules.

Use Verto translation filters to skip fields or objects that should remain untranslated.

Actions are ideal for side effects such as syncing license state to external systems.

Best practices

Build reliable LemonX extensions.

Do not edit LemonX core files

Put customizations in a site-specific plugin, mu-plugin or child theme so updates do not overwrite your changes.

Use documented hooks only

Prefer hooks referenced in LemonX developer docs and source. Undocumented internals may change between releases.

Return values from filters

Every filter callback must return the modified value. Forgetting the return value is one of the most common extension bugs.

Validate permissions in callbacks

Check current_user_can() or equivalent capability rules before changing write behavior, tools or publishing logic.

Keep callbacks lightweight

Heavy work belongs in queued jobs, REST endpoints or async tasks — not in filters that run on every page render.

Test on staging first

Hook changes can affect SEO output, AI tools, translation and licensing. Always validate on staging before production.

Document custom hooks for your team

Agencies should maintain an internal list of custom LemonX hooks, owners and affected client sites.

Version your custom plugin

Track which LemonX release your customizations were tested against and re-test after major upgrades.

Anti-patterns

Avoid these common mistakes.

Editing plugin source directlyChanges will be lost on update and may break support coverage.
Removing default tools without reviewStripping MCP tools or Pro features can break expected LemonX Suite workflows.
Unbounded filter recursionCalling LemonX functions inside filters that those same functions trigger can cause infinite loops.
Bypassing capability checksNever force allow on security-sensitive filters just to make automation easier.
Relying on undocumented internalsPrivate functions and unlisted hooks are not a stable extension surface.
Compatibility

Where custom LemonX code should live.

  • Use a dedicated plugin: Create a small custom plugin for LemonX hooks so they are portable across environments.
  • Prefer filters for output changes: SEO fields, schema, frontend HTML and tool lists should usually be modified with filters.
  • Prefer actions for integrations: CRM sync, logging, notifications and external webhooks fit actions better.
  • Combine with REST and webhooks: Hooks handle in-process WordPress logic; REST and webhooks handle external system coordination.
  • Check Pro and product entitlements: Some hooks affect features that still require the relevant LemonX product or Pro plan to be active.
Example workflows

What can developers build with hooks and filters?

Workflow 1

Agency MCP customization

Goal: Give each client site custom AI tools without forking LemonX MCP.

  1. Register tools with lemonx_mcp_tools
  2. Restrict writes with lemonx_mcp_allow_writes_without_pro
  3. Log activity via custom action handlers
  4. Test tools in Claude Desktop or Cursor

Result: Client sites keep standard LemonX MCP while your agency adds safe, scoped custom tools.

Workflow 2

Custom schema for a post type

Goal: Output specialized Schema.org data for a custom post type used in AI search pages.

  1. Hook lemonx_aeo_jsonld_graphs
  2. Detect post type inside callback
  3. Append or modify graph nodes
  4. Validate output in Rich Results or AEO tools

Result: AEO and search systems receive structured data aligned with your content model.

Workflow 3

Translation governance

Goal: Translate marketing pages but keep legal and pricing footers unchanged.

  1. Use lxt_should_translate_object to skip fields
  2. Adjust lxt_translatable_post_types if needed
  3. Review Verto queue results
  4. Validate hreflang and localized SEO output

Result: Multilingual workflows stay fast while sensitive content remains consistent across locales.

Workflow 4

License-aware feature rollout

Goal: Enable beta features only for agency-managed client sites with active Pro licenses.

  1. Hook lemonx_pro_feature_allowed
  2. Inspect entitlement payload
  3. Allow selected features per plan
  4. Listen to lemonx_pro_license_changed for cache busting

Result: Feature access stays aligned with billing and deployment policies across many sites.

Extend LemonX without breaking updatability.

Use documented hooks and filters to customize AI workflows, SEO output, translation behavior, MCP tools and Pro licensing — while keeping LemonX core maintainable.

Hooks & Filters FAQ

What is the difference between a hook and a filter in LemonX?
In WordPress terms, filters modify and return values; actions run at lifecycle points without returning a main value. LemonX uses both patterns across its modules.
Where should I put custom LemonX hook code?
Use a custom plugin, mu-plugin or child theme. Do not edit LemonX core plugin files directly.
Can I extend MCP tools with hooks?
Yes. The lemonx_mcp_tools filter is the primary extension point for adding or modifying MCP tools exposed to AI clients.
Can hooks replace the REST API?
No. Hooks customize behavior inside WordPress. REST API is for external applications and remote integrations. They complement each other.
Are all LemonX hooks public and stable?
Documented developer hooks are intended for extension. Undocumented hooks or internal functions may change between releases.
Do hooks bypass LemonX permissions?
No. Your callback still runs within WordPress and LemonX permission rules. Do not use hooks to bypass capability checks.
Can I use hooks to modify SEO and Schema output?
Yes. AEO filters such as lemonx_aeo_jsonld_graphs, lemonx_aeo_title_vars and lemonx_aeo_post_content are common extension points.
Does Verto use lemonx_ or lxt_ hooks?
Both. LemonX integration points may use lemonx_* names, while Verto translation behavior often uses lxt_* filters.
Will my hooks survive LemonX updates?
Yes, if they rely on documented extension points and live outside core plugin files. Re-test after major upgrades.
Can agencies use hooks for multi-site workflows?
Yes. Agencies often use hooks to standardize MCP tools, schema rules, translation policies and license behavior across client sites.

Build WordPress AI workflows your team can maintain.

Combine hooks and filters with REST API, MCP tools, authentication and webhooks to create a developer platform that fits your agency, product team or enterprise WordPress stack.