NPC Slug Genius

Deskripsi

NPC Slug Genius is built for Japanese WordPress sites that want short English URL slugs without the manual translation work.

A literal translation of a Japanese title does not always make a good slug. A word-for-word translation can give you slugs like recruitment-information (from 採用情報) or company-introduction (from 会社案内).

NPC Slug Genius takes a different approach: its prompt instructs the AI to use the short English words that websites commonly use for such pages, such as careers and about-us. For Japanese-specific concepts that have no clean English equivalent (補助金 program names, etc.), the AI is instructed to keep the Romaji and translate only the surrounding words, for example apply-monozukuri-subsidy. The actual output is generated by the AI model and may vary.

Key features:

  • Automatic English slug generation on post save
  • Manual slugs are respected: a slug you type using only English letters, numbers and hyphens is left as is, and a generated slug that you edit is locked (see the FAQ for details)
  • Safe by default for existing sites: posts dated before the plugin was first activated on the site are skipped unless you opt in (see the FAQ for details)
  • Configurable target post types
  • Safe fallback: if the API key is missing or the API call fails, the post saves normally with no error
  • BYOK (Bring Your Own Key): you control the API usage and cost

Supported AI providers (choose any one):

  • Anthropic Claude (Claude Haiku 5.5 model)
  • OpenAI ChatGPT (GPT-6 Luna model)
  • Google Gemini (Gemini 3.5 Flash-Lite model)

You only need an API key from one provider. Switch between providers anytime from the settings page.

Getting started:

  1. Install and activate the plugin.
  2. Go to Settings > NPC Slug Genius.
  3. Choose your preferred AI provider from the dropdown.
  4. Get an API key from the provider’s console and paste it in:
  5. Choose which post types should get automatic slug generation (default: posts and pages).
  6. Create a post with a Japanese title – the slug will be automatically generated when you save.

External services

This plugin connects to one of three AI provider APIs (whichever the user selects in the settings) to generate English URL slugs from Japanese post titles. Only the provider you actively select is contacted; the other two are not used.

What the services are and what they are used for:
These are large language model APIs used to translate Japanese post titles into English URL slugs. The plugin uses a low-cost lightweight model from whichever provider you select.

What data is sent and when:
The plugin sends the post title (text only) to the selected provider’s API, together with a fixed instruction text included in the plugin and the API key for authentication. The request is made only when a post that the plugin processes is saved (see the FAQ for which posts are processed) AND an API key for the active provider is configured in the plugin settings. If no API key is configured for the active provider, no request is made. The plugin does not send the post content, author, or other user data. The request is made with the WordPress HTTP API, whose default User-Agent header includes your WordPress version and your site URL. As with any network request, the provider can also see the IP address of your server.

Anthropic Claude (provided by Anthropic, PBC)

  • Endpoint: https://api.anthropic.com/v1/messages
  • Anthropic Consumer Terms of Service: https://www.anthropic.com/legal/consumer-terms
  • Anthropic Commercial Terms of Service: https://www.anthropic.com/legal/commercial-terms
  • Anthropic Usage Policy: https://www.anthropic.com/legal/aup
  • Anthropic Privacy Policy: https://www.anthropic.com/legal/privacy

OpenAI ChatGPT (provided by OpenAI, L.L.C.)

  • Endpoint: https://api.openai.com/v1/chat/completions
  • OpenAI Terms of Use: https://openai.com/policies/row-terms-of-use/
  • OpenAI Usage Policies: https://openai.com/policies/usage-policies/
  • OpenAI Privacy Policy: https://openai.com/policies/row-privacy-policy/

Google Gemini (provided by Google LLC)

  • Endpoint: https://generativelanguage.googleapis.com/v1beta/models/gemini-3.5-flash-lite:generateContent
  • Google APIs Terms of Service: https://developers.google.com/terms
  • Gemini API Additional Terms of Service: https://ai.google.dev/gemini-api/terms
  • Google Privacy Policy: https://policies.google.com/privacy

By obtaining an API key from your chosen provider and using this plugin, you agree to that provider’s terms.

Privacy Policy

When a post that this plugin processes is saved and an API key is set for the provider you selected (Anthropic Claude, OpenAI ChatGPT, or Google Gemini), this plugin sends the post title to that provider. The post title is processed to generate an English slug and is not stored by this plugin beyond the resulting slug.

Of your site’s content, only the post title is sent, together with a fixed instruction text included in the plugin. If a title contains personal information (for example, a person’s name), that text is sent. The request also includes the API key for authentication and WordPress’s default User-Agent header (your WordPress version and site URL), and the provider can see your server’s IP address. This plugin does not collect any other personal data.

Instalasi

  1. Upload the plugin folder to /wp-content/plugins/, or install through the WordPress admin.
  2. Activate the plugin.
  3. Go to Settings > NPC Slug Genius and configure your API key.

Tanya Jawab

Do I need an API key to use this plugin?

Yes. You need an API key from one of the supported providers (Anthropic, OpenAI, or Google). You only need one – whichever you prefer.

How much does it cost to run?

Each slug generation is one API request: a fixed instruction text included in the plugin (about 3 KB) plus the post title, with a reply limited to 64 tokens. The plugin uses a low-cost model from each provider (Claude Haiku 5.5, GPT-6 Luna, Gemini 3.5 Flash-Lite). The actual cost depends on the provider’s current pricing and on how often you save posts that need a new slug, so please check your provider’s pricing page.

Can I switch between providers later?

Yes. You can change the active provider from the settings page anytime. API keys for unused providers are kept in your settings (but never sent anywhere) until you delete them.

What if my API key is wrong or the API is down?

The plugin fails silently. Your post saves normally with the default WordPress slug behavior (which keeps the Japanese title as the slug). No errors are shown to the visitor. If the provider does not respond, saving may take up to 30 seconds while the plugin waits for it. When the API call succeeds again, saving such a post replaces its Japanese slug if the post meets the conditions in “Which posts does this plugin process?” below, which changes its URL.

Which posts does this plugin process?

When a post is saved, the plugin tries to generate an English slug only if all of the following are true:

  • The post type is selected in the settings.
  • An API key is set for the active provider.
  • The post has a title, it is not an auto-draft, a revision, an attachment, or in the trash, and the user saving it has permission to edit it.
  • The current slug is empty, contains non-ASCII characters such as Japanese, or contains a percent sign followed by two hexadecimal digits (the percent-encoded form that WordPress uses for Japanese, such as %e3).
  • The slug is not locked (see the next question).
  • One of these applies: this plugin has generated a slug for the post before; you enabled “Also process posts created before plugin activation”; or the time the plugin was first activated on this site is recorded and the post is dated on or after it (posts that have no date yet, such as most unpublished drafts, count as new). The activation time is normally recorded when the plugin is activated.

If the API call fails, the AI’s reply is cut off before it is complete (for example, at the reply limit), or WordPress cannot save the new slug, the post saves normally and the slug is not changed.

Can I edit the auto-generated slug manually?

Yes. A slug that you type yourself using only English letters, numbers and hyphens is never replaced.

Once this plugin has generated a slug for a post, saving the post with a different, non-empty slug locks it. After that, the plugin does not generate a slug for that post again, even if you change the slug back to Japanese. On a published post, WordPress fills an empty slug from the title, so clearing the slug field usually results in a locked Japanese slug.

One exception to this lock: if the slug is exactly the one that WordPress makes from the generated slug when the post is published under its current parent, it does not count as a change and does not lock the slug. A slug that you type yourself is not locked either if it is exactly that slug. WordPress adds a number such as “-2” in these cases:

  • Another post already uses the slug (for example, “contact-2” when you publish a draft whose slug “contact” is used by another post).
  • The slug is a reserved word such as “feed”.
  • The slug is made only of numbers, depending on the post type and permalink settings.

The slug can still be locked in these cases:

  • You move a draft or pending page (or a post of another type that can have a parent) to another parent, or out from under its parent, in Quick Edit (WordPress adds the number based on the previous parent).
  • The post got the number while it was saved without this plugin’s check (for example, while the plugin was inactive, while its post type was not selected in the settings, by a user or tool without permission to edit it, or while version 1.1.1 or earlier was active), and the slug without the number (for example, “contact”) became free before the post was saved again (for example, the other post that used it was deleted, moved to the Trash, or given a different slug).
  • Version 1.1.1 or earlier could not save the generated slug for the post, so the post still has its Japanese slug.

Slugs that were locked by an earlier version stay locked after updating.

What data is sent to the AI provider?

The post title, together with a fixed instruction text included in the plugin and the API key of the selected provider (for authentication). The post content, author, categories, tags, and other user data are not sent. If the title itself contains personal information (for example, a person’s name), that text is sent as part of the title. See “External services” below for details.

Does this work with custom post types?

Yes. Public post types, including public custom post types, are listed under Settings > NPC Slug Genius. Check the ones you want.

I installed this on a site with existing Japanese posts. Will their URLs change?

Not by default. Posts dated before the plugin was first activated on this site are skipped, to protect existing URLs. The settings page shows this time as “Plugin was activated on”. Deactivating and reactivating the plugin does not change it; deleting the plugin resets it.

However, a post dated on or after that time that still has a Japanese slug (for example, because the plugin was inactive, no API key was set, or the API call failed when the post was published) gets an English slug the next time it is saved, if it meets the conditions in “Which posts does this plugin process?” above. This changes its URL.

If you want older posts to be processed as well, enable “Also process posts created before plugin activation” in the settings. This does not convert posts in bulk: each post is processed the next time it is saved (warning: this changes existing URLs). Locked slugs are not changed.

Ulasan

Belum ada ulasan untuk plugin ini.

Kontributor & Pengembang

“NPC Slug Genius” adalah perangkat lunak open source. Berikut ini mereka yang sudah berkontribusi pada plugin ini.

Kontributor

Log Perubahan

1.1.3

  • Fixed: a slug generated for a draft or pending post could be the same as the slug of a published post or page, because WordPress does not add a number to the slug of a draft. When the published one was saved again, WordPress changed its slug (for example, from “about-us” to “about-us-2”), and for a page (or another post type that can have a parent) the old URL stopped working. The plugin now gives the draft a slug that is not in use, such as “about-us-2”. If you are replacing an old page with a new draft, the new draft also gets a numbered slug while the old page exists; after you remove the old page, change the new page’s slug if you want to keep the old URL.
  • A draft can still have the same slug as a published post or page if it got that slug with version 1.1.2 or earlier, or if WordPress gives it back a slug that is now in use (for example, when you restore the draft from the Trash, or when you move a draft page to another parent in Quick Edit and keep it as a draft). The plugin does not change a slug that is already in English. Before you save the published post or page again, publish the draft, or clear the draft’s slug and save it. Either way the duplicate goes away. When the API key works and the draft meets the conditions in “Which posts does this plugin process?” (for example, its slug is not locked), the plugin also generates a new slug such as “about-us-2”; check the draft’s slug after saving.

1.1.2

  • Updated the AI models. Google Gemini now uses Gemini 3.5 Flash-Lite, so that Gemini works for users who have not used the Gemini 2.5 models before (Google limits the 2.5 models to users who have used them in the past). OpenAI ChatGPT now uses GPT-6 Luna (GPT-4o mini will be removed from the OpenAI API on January 14, 2027). Anthropic Claude now uses Claude Haiku 5.5.
  • Fixed: a reply that the AI did not finish (for example, one cut off at the reply limit) could be used as a shortened slug. Such a reply is now ignored and the slug is not changed.
  • Fixed: if WordPress could not save the generated slug, or added a number such as “-2” because the slug was already in use, was a reserved word such as “feed”, or was made only of numbers (including when a draft is published later), the next save could treat the slug as manually edited and lock it. See the FAQ for the cases in which the slug can still be locked.

1.1.1

  • Tested with WordPress 7.0.

1.1.0

  • Added OpenAI ChatGPT provider (GPT-4o mini model).
  • Added Google Gemini provider (2.5 Flash model).
  • Settings page now shows only the API key field for the selected provider.
  • Saved API keys for non-active providers are preserved until you delete them.

1.0.0

  • Initial release.
  • Anthropic Claude provider (Haiku model).
  • Settings page with API key, provider selection (Claude only for now), and target post types.
  • Manual slug protection.
  • Admin notice when API key is missing.
  • Safe-by-default: existing posts (created before activation) are skipped to protect existing URLs.