Linux 软件免费装
Banner图

Default Permalink

开发者 (this should be a list of wordpress.org userid's)
redwoodcity
更新时间 2026年11月23日 01:53
捐献地址: 去捐款
PHP版本: 7.4 及以上
WordPress版本: 7.1
版权: GPLv2 or later
版权网址: 版权信息

标签

permalink url slug default multi-byte

下载

1.14.0 1.1 1.13.0 1.12.0 1.0 1.4 1.2 1.10.2 1.5 1.5.1 1.9.1 1.10.3 1.11.0

详情介绍:

When a post title contains multi-byte characters (such as Japanese), WordPress generates a URL-encoded slug like %e3%81%82..., which results in a long and unreadable permalink. This plugin replaces such auto-generated slugs with {post_type}-{post_ID} (e.g. post-123). A multi-byte slug is kept as-is when the user has explicitly specified it. Optionally, new categories, tags and other terms with a multi-byte name can get a slug such as category-12. Usage
  1. Go to "Settings" -> "Default Permalink" in the WordPress admin.
  2. Check "Enable" and save changes.
Slug formats, target post types, the bulk conversion and more are explained in the usage guide: https://www.redwoodcity.jp/app/default-permalink/en/usage-en/ WP-CLI Convert a single post In the post, page and media lists, a post that still has a multi-byte slug shows a "Convert slug" link under its title (when the plugin is enabled and you can edit the post). It converts just that post to the selected format; the old URL is redirected to the new one. Site Health Tools -> Site Health recommends enabling the plugin when it is installed but not enabled, and shows how many posts still have multi-byte slugs, with a link to the settings screen.

安装:

  1. Upload the default-permalink folder to the /wp-content/plugins/ directory.
  2. Activate the plugin through the 'Plugins' menu in WordPress.
  3. Enable the plugin's behavior from "Settings" -> "Default Permalink".

升级注意事项:

1.9.1 Behavior changes since 1.5.1: posts created via the REST API, WP-CLI, wp_insert_post() or media uploads now get the replacement slug, and clearing a published post's slug replaces it too. A slug you enter explicitly is still kept.

常见问题:

Can I still use a Japanese (multi-byte) slug?

More questions and answers: https://www.redwoodcity.jp/app/default-permalink/en/faq-en/ Yes. A slug you enter explicitly (in the editor's URL/slug field, Quick Edit, the REST API slug parameter, etc.) is kept as-is. Only slugs generated automatically from the title are replaced. If you clear the slug and save, a new one is generated and replaced.

Which posts are affected?

Posts of the selected post types, saved from the editor or created directly (REST API, WP-CLI, wp_insert_post(), media uploads). Existing posts are not changed until you run the bulk conversion.

Does it change category and tag slugs?

Only if you select them under "Target taxonomies" (off by default). New terms get a slug such as category-12. Existing terms are not changed, because WordPress does not redirect old term URLs.

How do I customize the slug format?

Use the default_permalink_slug filter for posts and default_permalink_term_slug for terms. The result is made unique automatically. Examples and parameters: https://www.redwoodcity.jp/app/default-permalink/en/docs-en/

What happens to old URLs after a slug is converted?

They are redirected to the new permalink (301). For posts and other non-hierarchical post types, WordPress stores the old slug. WordPress does not do this for pages and other hierarchical post types, so since 1.12.0 the plugin stores the old path of a published page it converts (bulk conversion, "Convert slug" or WP-CLI) and redirects it, including the URLs of its child pages. Pages converted before 1.12.0, and page slugs changed by hand, are not redirected automatically: you can register such an old URL under "Old URLs of pages" on the settings screen (since 1.14.0) or with wp default-permalink old-path add <ID> <path> (since 1.13.0), or set up a redirect yourself. Use the default_permalink_redirect_old_paths filter to turn the page redirects off.

更新日志:

1.14.0 1.13.0 1.12.0 1.11.0 1.10.3 1.10.2 1.10.1 1.10.0 1.9.2 1.9.1 1.9.0 1.8.0 1.7.0 1.6.0 1.5.1 1.5 1.4 1.3 1.2 1.1 1.0