Weglot ability reference
Reference for the GoBuildWP Pro 1.12.4 source. Installed schemas and policy remain authoritative.
This Weglot ability reference lists every call GoBuildWP Pro registers for Weglot languages, exclusions and translated URLs, with the exact slug an agent sends and what the plugin's own contract says it does. Of the 19, 7 read, 5 write and 7 are marked destructive in the source.
Read-only, write and destructive groups describe the source annotations. They do not establish a minimum safety profile, human approval or undo support. Those controls are separate: check the installed ability, the connected user and the active site policy before calling it. A read can still return sensitive data. These pages are not evidence that every operation passed an end-to-end runtime test.
What Weglot needs before these load
These 19 abilities come with GoBuildWP Pro 1.12.4. Pro registration requires the Freemius SDK to permit premium code and any companion dependency the module checks to be available. The floors below apply to the named dependencies or features; an optional add-on or newer feature floor does not necessarily disable the base module. wppilot/integration-health and the module's setup call describe the installed availability.
- Minimum (base)
- 5.0
WPPILOT_PRO_WEGLOT_MIN_VERSION - Weglot editions
- free, pro
- Agent skills shipped
weglot-integration
Weglot reads
| Ability | What it does |
|---|---|
wppilot/weglot-check-setupCheck Weglot Setup | Reports the Weglot Translate environment: whether Weglot is active, its version, whether the API key is configured (masked output), the cloud project name and plan, language limits, the source language and the destination-language codes, and whether the plan includes translated URL slugs. Call this first before any other Weglot ability. |
wppilot/weglot-get-settingsGet Weglot Settings | Returns the Weglot settings actually in force, scoped to a section: "languages" (source + destination + auto-switch), "button" (language-switcher style: dropdown, flags, name visibility, flag type), "advanced" (translate-search, translate-amp, translate-email, custom CSS, and which languages are kept private), or "all" (combined). Resolved the way Weglot itself resolves its configuration, so cloud-managed values (languages, exclusions, engine) are included even on an install where the admin only pasted the API key. API keys are never returned. Use weglot-get-status for project/plan/quota data. |
wppilot/weglot-get-statusGet Weglot Cloud Status | Queries the Weglot Cloud /projects/owner endpoint with the configured API key and reports the live project status: project name, plan id and label, the destination-language limit, and word usage against the plan quota. The organization and project slugs come from the project settings, which are resolved locally. Error contract: weglot_no_api_key when no key is set, weglot_cloud_key_invalid when the cloud rejects the key (rotate it, do not retry), weglot_cloud_unreachable for a transient network or upstream failure (retry). |
wppilot/weglot-get-translation-cache-stateGet Weglot Translation Cache State | Reports the state of the Weglot local CDN cache transients (weglot_cache_cdn for the merged options snapshot, weglot_slugs_cache for translated URL slugs) Useful for debugging stale-local vs cloud-truth issues: tells the agent whether a cache entry exists, when it was last set (best-effort - WP transients do not expose creation time, so we report whether the row is present in wp_options and the timeout if available), and the default TTL Weglot configures. |
wppilot/weglot-list-exclude-urlsList Weglot URL Exclusions | Returns the URL-exclusion rules persisted in the local Weglot v3 cache: each rule has a match pattern, a type (one of Weglot's nine match modes: START_WITH, CONTAIN, IS_EXACTLY, MATCH_REGEX, their negations, …), and the optional list of language codes it applies to. Rules with an empty language list apply to every destination language. Output is compact: progressive disclosure clamps limit to a sane default; use weglot-get-settings + section="all" for the full options blob. |
wppilot/weglot-list-languagesList Weglot Supported Languages | Returns the full catalog of languages Weglot supports (110+), each with its ISO code, English name, native name, and RTL flag. Use this catalog to look up the code expected by weglot-add-destination-language and weglot-set-original-language. The query input filters by code prefix or name substring; limit clamps the response size for progressive disclosure. |
wppilot/weglot-list-translated-urlsList Weglot Translated URL Slugs | Flattens the Weglot custom_urls v3 cluster (per-language slug overrides) into a list of {language, from_slug, to_slug} entries. The optional language input filters by ISO code. Output is compact and limit-clamped for progressive disclosure; use weglot-get-settings for raw cluster shapes. |
Weglot writes
| Ability | What it does |
|---|---|
wppilot/weglot-add-destination-languageAdd Weglot Destination Language | Adds an ISO language code to the Weglot destination-language list (translations Weglot generates TO). The code must exist in the SDK catalog, must NOT equal the source language, and must NOT already be configured. The optional custom_name overrides the language switcher display name. enabled (default true) is the only visibility switch Weglot has: set it to false to make the language PRIVATE - served to logged-in admins as a preview, hidden from visitors - which is what the Weglot dashboard calls a private language. |
wppilot/weglot-add-exclude-urlAdd Weglot URL Exclusion | Appends a URL-exclusion rule to the Weglot excluded_paths v3 option. value is the path or regex Weglot matches against the requested URL. type is one of Weglot's nine match modes (START_WITH, NOT_START_WITH, END_WITH, NOT_END_WITH, CONTAIN, NOT_CONTAIN, IS_EXACTLY, NOT_IS_EXACTLY, MATCH_REGEX) or an alias - "regex"=MATCH_REGEX (write the pattern itself, e.g. "^/en(/|$)"; if you wrap it in /…/ the delimiters are stripped before persisting, because Weglot adds its own and would otherwise treat yours as literal characters, leaving a rule that matches nothing), "path"=section shortcut that compiles to a MATCH_REGEX matching the path, its root and everything under it ("/en" excludes /en and /en/* but NOT /enterprise; the response echoes the compiled rule). Omit it and a value with no slashes is CONTAIN (Weglot's own default); a slash-wrapped value with NO type is refused, because both readings of it are broken - pass "regex" or "CONTAIN" to say which you meant. languages is an optional ISO-code list - when empty the rule applies to every destination language. Duplicates (same type + value + languages) are rejected with weglot_invalid_input - but an inert legacy string-form entry never counts as a duplicate, so it cannot block a working rule. Returns the new total and the index assigned to the rule (matches the index exposed by weglot-list-exclude-urls). |
wppilot/weglot-add-translated-urlAdd Weglot Translated URL Slug | Sets a translated URL slug for a destination language under the Weglot custom_urls cluster (e.g. "/about-us" → "/qui-sommes-nous" for fr). The destination language must already be configured (use weglot-add-destination-language first). Replaces any pre-existing slug for the same source page and returns previous_to_slug for rollback. IMPORTANT and different from every other write here: this pair takes effect on THIS site immediately, and it can NOT be published to the Weglot Cloud. Translated slugs are not part of the project settings - Weglot keeps them on a separate resource (/translations/slugs), which weglot-push-options-to-cloud does not carry. Because the settings payload has no custom_urls, the merge Weglot performs takes the value from the local store, so the site serves it right away. To have the slug on the Weglot project itself (for other installs, or to see it on the dashboard) edit it at dashboard.weglot.com - but only if the plan allows it: when weglot-check-setup reports supports_slugs=false the slug resource answers 403 and the project cannot hold slugs at all, so the pair stays local and there is nothing to do on the dashboard either. |
wppilot/weglot-clear-translation-cacheClear Weglot Translation Cache | Deletes the Weglot local CDN cache transients: weglot_cache_cdn (the merged options snapshot, default 300s TTL) and weglot_slugs_cache (translated URL slug cache). Also busts the per-request user-info cache used by check-setup and get-status. The next page load (or ability invocation that touches the cloud) re-fetches fresh data. Use this when local data appears stale after upstream cloud edits or after a settings push. |
wppilot/weglot-edit-button-settingsEdit Weglot Button (Language Switcher) Settings | Partial-update for the language switcher button stored under custom_settings.button_style: only the fields included in the input are touched, everything else is preserved. Use weglot-get-settings (section=button) first to read the current shape. Booleans: full_name (long vs ISO code label), with_name (show label), is_dropdown (dropdown vs flat list), with_flags (show country flags). flag_type accepts the four styles Weglot defines: "rectangle_mat", "shiny", "circle", "square" (see Helper_Flag_Type). The numeric aliases Weglot maps internally (0-3) are NOT accepted here - the schema enum rejects them. custom_css overrides the bundled switcher CSS. |
Destructive Weglot calls
| Ability | What it does |
|---|---|
wppilot/weglot-delete-destination-languageDelete Weglot Destination Language | Removes a destination language from the Weglot configuration. The local-side translations cache is dropped immediately; cloud-side translations stay in the Weglot project until the language is re-added or the project is reset. |
wppilot/weglot-delete-exclude-urlDelete Weglot URL Exclusion | Removes a URL-exclusion rule by its index (the position reported by weglot-list-exclude-urls). Indexes are re-numbered after each delete - fetch the list again before subsequent deletes in the same batch. Returns weglot_unknown_index when the index is out of range. After delete the remaining rules are stored contiguously (re-indexed). |
wppilot/weglot-delete-translated-urlDelete Weglot Translated URL Slug | Removes a translated URL slug entry from the Weglot custom_urls cluster, identified by language + from_slug. Returns weglot_unknown_slug when no entry matches. If removing the entry leaves an empty per-language map the language key is dropped to keep the persisted blob tidy. IMPORTANT: the deletion takes effect on THIS site immediately and can NOT be published to the Weglot Cloud - slugs live on a separate resource (/translations/slugs) that the settings push does not carry. If the slug also exists on the Weglot project, remove it at dashboard.weglot.com - possible only on a plan with the slug feature: when weglot-check-setup reports supports_slugs=false the project cannot hold slugs at all, so there is nothing to remove there. |
wppilot/weglot-push-options-to-cloudPush Weglot Options to Cloud | Publishes the pending local Weglot edits (languages, exclude rules, button style) to the Weglot Cloud so they take effect for visitors. This is the missing piece for the write abilities: set-original-language, add/delete-destination-language, add/delete-exclude-url and edit-button-settings persist locally pending the settings push. Custom translated URL slugs affect local matching immediately and use a separate cloud resource. The endpoint merges server-side and the ability sends only the keys the write abilities changed, so settings edited on dashboard.weglot.com that no ability touched stay as they are; a key changed both on the dashboard and through an ability is overwritten with the ability's value. NOTE: translated URL slugs are NOT publishable here; Weglot keeps them on a separate resource, so add/delete-translated-url never appear among the published keys. Requires the private API key (the cloud rejects /projects/settings calls with only the short public key). Returns which keys were overlaid, plus the cloud answer, and clears the local weglot_cache_cdn transient so the next page load re-fetches. |
wppilot/weglot-refresh-from-cloudRefresh Weglot Options from Cloud | Forces a fresh fetch of the Weglot project settings from the cloud: clears the local weglot_cache_cdn and weglot_slugs_cache transients, calls /projects/settings, and rehydrates the local v3 options blob with the cloud response (merged on top of locally-persisted defaults the cloud does not return). Use this when the admin has edited slugs / languages / exclusions on dashboard.weglot.com and you want the local cache to reflect cloud truth before the next page-load auto-refresh. |
wppilot/weglot-set-api-keySet Weglot API Key | Sets (or rotates) the Weglot API credentials. The required public_key (short "wg_..." token) is ALWAYS validated against /projects/owner before being persisted; if the cloud rejects it (weglot_cloud_key_invalid) or is unreachable (weglot_cloud_unreachable), nothing is saved and the current key is preserved. The optional private_key is validated separately when supplied and reports weglot_private_key_invalid on failure. Both credentials carry the same "wg_" prefix on current projects - tell them apart by role, not by prefix: the public one is what the settings page shows as the site key, the private one is the longer token the dashboard issues for API writes. Required for supported settings pushes; this module does not expose glossary or cloud slug publishing abilities; omit the field to keep the current private key, or pass an empty string to CLEAR it. Returns the project name and plan reported by the richer probe on success. |
wppilot/weglot-set-original-languageSet Weglot Original (Source) Language | Sets the source language Weglot translates FROM (stored as language_from in the v3 options). This writes local options and marks changed cloud-owned keys pending publication; it does not itself publish the new source to the cloud. Changing the source of a configured cloud project can disrupt existing translations, so confirm the intended project change before publishing and inspect the cloud result. The language code must exist in the bundled SDK catalog (use weglot-list-languages to validate); a destination language matching the new source is automatically removed to keep the configuration consistent. |
For the task-level view of Weglot, with worked requests and what to check afterwards, see Weglot integration page.