Chinese to English Slug Converter WP Registry grade A. No security issues foundWP RegistryNo security issues foundOpen the reportA
A WordPress plugin that automatically translates Chinese post titles to English slugs using Google Translation API. / 自動將 WordPress 文章的中文標題翻譯成英文 Slug 的外掛(使用 Google 翻譯 API)。
Install
Upload it under Plugins → Add New Plugin → Upload Plugin, then activate.
Install straight from GitHub with WP-CLI:
wp plugin install https://github.com/ivanusto/zh-to-en-slug/releases/download/v1.3.0/zh-to-en-slug-v1.3.0.zipA WordPress plugin that automatically converts Chinese post titles into English slugs using the Google Cloud Translation API, creating clean and SEO-friendly URLs for your content.
Key Features
- Automatic translation of Chinese titles to English slugs
- Post ID appended to slug on updates; WordPress core guarantees uniqueness for new posts
- Translation results cached for 7 days to reduce API usage
- Configurable maximum slug length
- Clean and SEO-friendly URL structure
- Easy-to-use settings interface
- API connection testing tool
- Support for both Traditional and Simplified Chinese
Requirements
- WordPress 6.0 or higher
- PHP 7.4 or higher
- Google Cloud Platform account with Cloud Translation API enabled
Installation
- Upload the plugin files to
/wp-content/plugins/chinese-to-english-slug, or install through the WordPress plugins screen - Activate the plugin through the Plugins screen in WordPress
- Go to Settings > Chinese to English Slug to configure the plugin
- Enter your Google Cloud Translation API key and configure your preferred maximum slug length
Getting a Google Cloud Translation API Key
- Go to Google Cloud Console
- Create a new project or select an existing one
- Enable the Cloud Translation API
- Create credentials (API key)
- Set usage restrictions for your API key
- Copy the API key to your plugin settings
How to Use
- Install and activate the plugin
- Go to Settings > Chinese to English Slug
- Enter your Google Cloud Translation API key
- Set your preferred maximum slug length
- Test your API connection using the test button
- Start creating posts with Chinese titles — slugs will be automatically converted
FAQ
Does this plugin require an API key? Yes, a Google Cloud Translation API key is required to translate Chinese text to English.
Is there a limit to how many translations I can do? The number of translations depends on your Google Cloud Platform account quota. The free tier includes a generous monthly allowance, but you may need to upgrade for high-volume sites.
What happens if the translation fails? The plugin falls back to WordPress's default slug generation behavior.
Can I modify an automatically generated slug? Yes, you can edit the slug manually after it's generated, just like any other WordPress post slug.
Does this work with custom post types? Yes, the plugin works with all post types that use slugs in WordPress.
Changelog
1.3.0
- Improve: generated slugs no longer append the post ID (e.g.
-13663); uniqueness is delegated to WordPress core, which only adds a numeric suffix on an actual collision. Existing slugs are not modified. - Improve: the full configured maximum length is now usable for the slug itself (previously 12 characters were reserved for the ID suffix, leaving only 18 of the default 30)
- Improve: truncation cuts at whole-word boundaries without discarding a word that fit exactly, and trims trailing function words (of, and, the, …) so slugs end on a meaningful word
1.2.2
- Fix: settings page and slug translation were completely disabled in 1.2.1 — the duplicate-class guard always triggered due to PHP compile-time class binding; the class declaration is now conditionally wrapped instead
- Fix: remove "Domain Path" header pointing to a folder not shipped in the release package
1.2.1
- Fix: guard against duplicate class declaration when two copies of the plugin are installed side by side
- Fix: bump "Tested up to" to WordPress 7.0
- Dev: ship a proper distribution zip (top-level folder
zh-to-en-slug) as a release asset
1.2.0
- Fix: request plain-text translations (
format=text) so HTML entities no longer leak into slugs - Fix: prevent empty slugs when max length is set too low (clamped to 20–200 with a hard floor)
- Fix: PHP notice when saved options were missing a key (defaults now merged via
wp_parse_args) - Improve: widen Chinese detection to cover CJK Extension A and the full basic CJK block
- Performance: cache translation results in transients for 7 days to reduce API calls
- Performance: lower API timeout from 15s to 8s so saving never hangs on a slow API
- Security: add capability check to the API test AJAX endpoint
- Security: API key field now uses a password input
- Add:
uninstall.phpcleans up options and cached translations on plugin removal - Add:
cts_allowed_statusesfilter; scheduled, pending, and private posts are now processed too - Dev: modernize
register_settingto the args-array signature
1.1.0
- Append post ID to generated slug to guarantee uniqueness across posts
- Refactor internal API call logic to eliminate code duplication
- Fix admin script version to match plugin version
- Improve JavaScript i18n: pass status strings through
wp_localize_script - Security: use
.text()instead of.html()when displaying API test results
1.0.0
- Initial release
Privacy Policy
This plugin sends post titles to Google Cloud Translation API for translation. Please ensure this complies with your privacy policy and data protection requirements.
The following data is sent to Google's servers:
- Post titles for translation
- Your API credentials
No personal data is stored or tracked by this plugin. For more information, visit Google Cloud Privacy.
Related Project
Need a full site toolkit instead of a single-purpose plugin? Omni Webmaster & SEO Suite bundles this slug translator (same core logic, plus a key-less fallback endpoint) together with SEO cleanup, comment control, thumbnail management, and Meta Pixel tracking.
Credits
- Developed by Ivan Lin
- Uses Google Cloud Translation API
License / 授權條款
This project is licensed under the GNU General Public License v2.0 or later (GPL-2.0-or-later).
Releases
4 releases. Each count is every asset in that release; expand a row for the breakdown.