AI Agents
Hand the setup to Claude Code, Cursor or Codex. Give your agent the guide on this page, and it installs Multilify, adds your languages and checks the result with WP-CLI.
Tell your agent
Paste this into the agent that works on your WordPress site. It reads the guide, shows you a plan and waits for your approval.
Read https://multilify.com/agents.md and set up Multilify on this WordPress site. Show me your plan before you change anything.
The prompt is for one setup. To make it last, add the guide to the file your tool reads at the start of every session, and the agent will know how Multilify works without being told again:
- Claude Code
CLAUDE.md- Cursor
.cursor/rules/multilify.mdc- Codex, Copilot
AGENTS.md
The step agents miss
A language added from the command line answers 404 until the rewrite rules are flushed. The settings screen does this for you, and wp rewrite flush does it from WP-CLI. The guide says so, because an agent that skips it reports success on a site that does not work.
# add Italian from the command line
wp option update multilify_languages '[… "it" …]' --format=json
Success: Updated 'multilify_languages' option.
# its address, before the flush
curl -so /dev/null -w "%{http_code}" example.com/it/prova-agente/
404
# the step agents miss
wp rewrite flush
Success: Rewrite rules flushed.
# the same address, after the flush
curl -so /dev/null -w "%{http_code}" example.com/it/prova-agente/
200The guide
The same text is served as /agents.md. Every command in it was run on a test site with WP-CLI 2.12.0 and Multilify 1.7.1.
# Multilify: setup guide for AI agents
> Multilify is a free WordPress plugin (GPL v2 or later) that makes a site multilingual without duplicating posts. Each translation is stored in the original post's own post meta, keyed by language code, and every language other than the default gets a URL prefix such as /de/. The plugin makes no outbound requests.
## Ground rules
- Show the user your plan and wait for approval before changing anything.
- On a live site, work on a staging copy first.
- Never edit or delete a post's own title, content or slug. Translations are stored beside them.
- Never delete the plugin to reset it. Deleting it from the admin removes every translation. Deactivating keeps them.
- Never change an existing language code. Translations are stored under it.
## 1. Check the site
```bash
wp core version # 5.8 or later
wp eval 'echo PHP_VERSION;' # 7.4 or later
wp option get permalink_structure # must not be empty, e.g. /%postname%/
```
## 2. Install
```bash
wp plugin install multilify --activate
wp plugin list --name=multilify --fields=name,status,version
```
## 3. Languages
```bash
wp option get multilify_languages --format=json
wp option get multilify_default_language
```
The list is an array of objects: `{"code":"de","name":"Deutsch","flag":"🇩🇪"}`. A code is two to five lowercase letters (`^[a-z]{2,5}$`). It becomes the URL prefix and cannot be a word WordPress uses in addresses (feed, page, embed, wp, index, tag, date, type, order, paged, cpage, rest, or the author, search, comments and pagination bases), nor the slug of an existing post or page.
The settings screen (Multilify in the admin menu) checks all of this. From the command line, write the whole list, then flush the rewrite rules:
```bash
wp option update multilify_languages '[{"code":"en","name":"English","flag":"🇬🇧"},{"code":"de","name":"Deutsch","flag":"🇩🇪"}]' --format=json
wp rewrite flush
```
Without the flush, the new language's addresses answer 404.
## 4. Translations
Each post has three meta keys per language:
```bash
wp post meta update <ID> _multilang_title_<code> "Translated title"
wp post meta update <ID> _multilang_slug_<code> "translated-slug"
wp post meta update <ID> _multilang_content_<code> "<p>Translated content</p>"
```
- The editor panel runs `sanitize_title()` on the slug and `wp_kses_post()` on the content. A script must do the same.
- A slug must be unique within its language. The panel numbers a duplicate (-2, -3), a script has to.
- An empty slug means the post's own slug is used under the prefix.
- A post with no translation shows the default text at the language's address, with its canonical on the default address.
- Posts and pages are translatable by default. Other post types are added with the `multilify_post_types` filter in PHP.
## 5. Language switcher
```text
[multilify_switcher]
[multilify_switcher show_name="false"]
<?php multilify_switcher(); ?>
```
## 6. Verify
```bash
curl -s -o /dev/null -w "%{http_code}\n" https://example.com/<code>/<translated-slug>/ # 200
curl -s https://example.com/<code>/<translated-slug>/ | grep -o '<html lang="[^"]*"' # the code
curl -s https://example.com/<code>/<translated-slug>/ | grep -o 'hreflang="[a-z-]*"' # the default, the code, x-default
```
## Filters
- `multilify_post_types`: which post types get translation panels.
- `multilify_translated_title`: the translated title as the theme prints it.
- `multilify_translated_content`: the translated content, before output.
- `multilify_flag_choices`: the flags offered on the settings screen.
- `multilify_locale`: the WordPress locale a language switches to.
- `multilify_enable_browser_detection`: whether a first-time visitor at the site root is redirected to their browser's language.
- `multilify_is_crawler`: whether a request counts as a crawler.
## Not supported
A domain or subdomain per language, codes with a hyphen such as pt-br, and translated menus, widgets, excerpts, categories, tags and custom fields.
## More
- Documentation: https://multilify.com/en/docs
- Questions: https://multilify.com/en/faq
- Source: https://github.com/kadirermantr/multilify
Files for machines
- /agents.md
The setup guide as plain Markdown, for an agent to read directly.
- /llms.txt
An index of this site for language models, in the llms.txt format.