LLM for Listeo: Developer Guide
Developer guide for LLM artifacts, REST search, settings, content filters, cache invalidation, listing data formatting, and license-safe extensions.
Architecture overview
The plugin registers rewrite-based public artifacts, a REST search endpoint, settings storage, cache management, section builders, listing formatters, exclusions, analytics, and updater/license classes.
listeo_llm_settings.llms.txt, llms-full.txt, and listeo-agent.json.Settings
Defaults are stored in Listeo_LLM_Settings::defaults(). Important controls include section inclusion/order, max items, max words, exposed fields, coordinate rounding, dedupe, noindex exclusion, WooCommerce exclusion, max file size, cache TTL, content priority, exposure level, and multilingual mode.
REST search
The plugin registers a readable REST route for search. It accepts sanitized parameters such as keyword_search, _listing_type, region, category, page, and per_page. The route returns 404 when licensed features are not enabled.
Listeo_LLM_License::features_enabled() to return true. Build integrations that respect the product license state.
Useful filters and actions
| Hook/filter | Purpose |
|---|---|
listeo_llm_default_settings | Adjust default settings before they are stored. |
listeo_llm_settings | Filter parsed runtime settings. |
listeo_llm_sections, listeo_llm_custom_sections | Change or add generated sections. |
listeo_llm_section_entries | Filter entries for a section. |
listeo_llm_markdown | Filter final markdown before it is cached/served. |
listeo_llm_agent_manifest | Filter the JSON manifest. |
listeo_llm_listing_object | Filter structured listing output. |
listeo_llm_search_query_args | Modify listing search query arguments. |
listeo_llm_cache_invalidated | React when cache is cleared. |
listeo_llm_regenerated | React after markdown regeneration. |
Listing data
The formatter reads Listeo meta such as _listing_type, _phone, _email, _website, _opening_hours_status, daily opening/closing fields, _friendly_address, _address, geolocation fields, event dates, and price fields. Keep custom meta compatible with these expectations or filter the listing object.
Exclusions
The plugin excludes content based on noindex state, WooCommerce pages, page IDs, slugs, and listing/page filters. Use listeo_llm_exclude_page, listeo_llm_exclude_listing, listeo_llm_exclude_page_ids, and listeo_llm_excluded_slugs for custom policy.
Safe customization examples
- Add a custom section with curated marketplace rules.
- Filter listing objects to remove sensitive fields.
- Clear a reverse-proxy cache after
listeo_llm_cache_invalidated. - Adjust max words or truncation strategy for brand tone.
- Keep license, updater, and feature-gate code untouched.
Test checklist
- Artifacts serve with correct content type and no PHP warnings.
- Search route sanitizes input and respects per-page limits.
- Noindex and excluded pages do not appear.
- Contact fields appear only when settings allow them.
- Cache invalidation runs after relevant content/settings changes.