| 开发者 |
(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 |
| 版权网址: | 版权信息 |
%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
wp default-permalink status shows the settings and the number of posts with a multi-byte slug.wp default-permalink convert --dry-run lists the posts to convert and their new slugs; wp default-permalink convert converts them all (no 50-post limit).--post_type, --limit and --after convert a large site in steps. See the documentation: https://www.redwoodcity.jp/app/default-permalink/en/docs-en/wp default-permalink old-path list, add <ID> <path> and delete <ID> <path> show, add and remove the old page URLs that are redirected (301) to a page.default-permalink folder to the /wp-content/plugins/ directory.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.
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.
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.
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/
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.
wp default-permalink old-path add). Adding and deleting require the capability to manage options and to edit the post, and every request is checked with a nonce.default_permalink_old_path_changed action, fired when an old URL is added or deleted by hand (settings screen or WP-CLI), for audit logs.wp default-permalink old-path list shows the stored old paths and where they redirect, add <ID> <path> registers an old URL for a page (for example one converted before 1.12.0 or whose slug was changed by hand), and delete <ID> <path> / --all removes them. A path that another post uses, the current URL of the post, or a URL on another site is refused.wp default-permalink status shows the number of stored old paths.wp default-permalink convert. WordPress only does this for posts, so converted pages used to return 404. The URLs of child pages under a converted page are redirected too. Only published pages converted from 1.12.0 on are covered; the default_permalink_redirect_old_paths filter turns this off.wp default-permalink convert --limit no longer suggests continuing with --after when no posts are left after the last processed one (only posts that failed or come before --after remain). With --dry-run, it now also shows the --after value to continue with.wp default-permalink convert accepts --after=<ID> to continue a run stopped by --limit.wp default-permalink convert now accepts --post_type=<types> and --limit=<number> to convert a large site in steps.default_permalink_record_notice filter to change this.wp default-permalink status and wp default-permalink convert [--dry-run].