外掛說明
如果想要控制 WordPress 網站的網址,Custom Permalinks 能讓網站管理員為任何文章、頁面、標籤或分類自訂唯一網址。這代表網站管理員可以依據需求設定網站結構,而不會受到 WordPress 預設設定的限制。網站管理員設定自訂永久連結後,內容的原始連結會自動重新導向至新的自訂網址。
主要功能
- A custom URL for any content: Set a unique permalink for any post, page, public custom post type (e.g. WooCommerce products), category, tag, or custom taxonomy term.
- Permalink structures per post type: Define a structure for each public post type from tags like
%year%,%category%, or your custom taxonomies. New content gets its permalink automatically, and you can still edit any permalink by hand. - Automatic redirects: The original URL redirects to the custom permalink, so existing links, bookmarks, and search rankings keep working.
- Multilingual: Works with WPML and Polylang, with a separate custom permalink for each translation.
- URLs in any language: Permalinks in non-Latin scripts, such as Arabic, Thai, or Cyrillic, work as you type them.
- All permalinks in one place: The Post Types Permalinks and Taxonomies Permalinks screens list every custom permalink, with search and bulk delete.
- A role for permalink managers: The Custom Permalinks Manager role lets non-administrators view and edit permalinks.
- Developer friendly: Filters and actions to add your own tags, generate permalinks in code, and control sanitizing and redirects.
開始使用:外掛設定
Custom Permalinks adds a Custom Permalinks menu to your WordPress dashboard:
- Post Types Permalinks and Taxonomies Permalinks: Every custom permalink on your site, with search and bulk delete.
- Post Types Settings: A permalink structure for each public post type, built from the tags below. Leave a structure empty to keep WordPress’s default for that post type.
To set a permalink for an individual post, page, category, or tag, edit that item and look for the Custom Permalink field near the top (or in the sidebar) of the editor screen — enter the URL path you want and save.
可用於永久連結結構的標籤
設定網站的自訂永久連結時,網站管理員可以使用多種標籤在網址中動態填入對應的值。以下是可供使用的標籤:
- %year%:內容的 4 位數發佈年份,例如 1972。
- %monthnum%:內容的 2 位數發佈月份,例如 11。
- %day%:內容的 2 位數發佈日期,例如 14。
- %hour%:內容的 2 位數發佈時間小時,例如 15。
- %minute%:內容的 2 位數發佈時間分鐘,例如 43。
- %second%:內容的 2 位數發佈時間秒數,例如 33。
- %post_id%:內容的唯一 ID,例如 1114。
- %category%: A clean version of the category name (its slug). Nested sub-categories will appear as nested directories in the URL.
- %author%: The post author’s username (login name). Note that this makes usernames visible in your URLs.
- %postname%: A clean version of the post or page title (its slug). For example, “This Is A Great Post!” becomes
this-is-a-great-postin the URL. - %parent_postname%:類似
%postname%,但如果選取上層頁面,則會使用上層頁面的代稱。 - %parents_postnames%:類似
%postname%,但如果選取多個上層頁面,則會使用全部上層頁面的代稱。 - %title%: The title of the post, converted to a slug. For example, “This Is A Great Post!” becomes
this-is-a-great-post. Unlike%postname%which is set once,%title%automatically updates in the permalink if the post title changes (unless the post is published or the permalink is manually edited). - %ctax_TAXONOMY_NAME%: A clean version of a custom taxonomy’s name. Replace
TAXONOMY_NAMEwith the actual taxonomy name. - %ctax_TAXONOMY_NAME_name%: The custom taxonomy term’s name (instead of its slug). Replace
TAXONOMY_NAMEwith the actual taxonomy name. - %ctax_parent_TAXONOMY_NAME%:類似
%ctax_TAXONOMY_NAME%,但如果選取上層項目,則網址會包含上層項目的代稱。 - %ctax_parent_TAXONOMY_NAME_name%: Similar to
%ctax_TAXONOMY_NAME_name%, but includes the immediate parent term’s name if a parent is selected. - %ctax_parents_TAXONOMY_NAME%:類似
%ctax_TAXONOMY_NAME%,但如果選取多個上層項目,則網址會包含全部上層項目的代稱。 - %ctax_parents_TAXONOMY_NAME_name%: Similar to
%ctax_TAXONOMY_NAME_name%, but includes all parent term names if parents are selected. - %custom_permalinks_TAG_NAME%: Developers have the flexibility to define their own custom tags (replace
_TAG_NAMEwith your desired name). To ensure these tags resolve to the correct permalinks, simply apply thecustom_permalinks_post_permalink_tagfilter.
重要通注意事項:在 Custom Permalinks 設定中完成結構定義後,針對撰寫的新內容,外掛在內容為草稿時會持續更新永久連結。內容發佈後或手動更新其永久連結,外掛會對這類內容停止自動更新。
Custom Permalinks:篩選器微調
Custom Permalinks 提供一系列讓開發者可以精準控制行為的篩選器,請前往這個外掛的 GitHub 存放庫查看全部可供使用的篩選器及完整的程式碼片段範例。
取得協助
- 付費使用者:如果在實作這些篩選器時需要協助,請透過付費使用者技術支援聯絡表單直接與我們聯絡。
- 其他使用者:請透過 LinkedIn 直接聯絡外掛開發者。
需要協助或找到程式碼錯誤?
- 技術支援:如需一對一電子郵件技術支援,請考慮購買 Custom Permalinks 付費方案。在 WordPress.org 技術支援論壇僅提供基本技術支援,電子郵件技術支援僅供付費方案使用者使用。
- 回報程式碼錯誤:如果在使用上遇到程式碼錯誤,請前往 GitHub 存放庫回報,並請務必提供可重現問題的完整資訊。GitHub 存放庫僅供回報程式碼錯誤,不提供技術支援。
如果外掛更新後造成網站停擺,請在技術支援論壇回報,或前往 GitHub 存放庫提供詳細資訊。如果需要還原為舊版外掛,請前往這個外掛的 [進階檢視] 下載。
螢幕擷圖





安裝方式
安裝 Custom Permalinks 有 2 種方式:
自動安裝
- Go to Plugins > Add New in your WordPress dashboard.
- 搜尋「Custom Permalinks」。
- 在 [外掛] 頁面中點擊 [立即安裝] 後然後點擊 [啟用]。
透過 FTP 手動安裝
- 下載
custom-permalinks資料夾。 - 將外掛安裝套件 ZIP 壓縮檔解壓縮所得的
custom-permalinks資料夾上傳至網站的/wp-content/plugins/目錄。 - 透過 WordPress 管理後台的 [外掛] 選單啟用 Custom Permalinks。
常見問題集
-
What happens to the original URL when I set a custom permalink?
-
Custom Permalinks automatically redirects the original (default) URL to your new custom permalink, so existing links, bookmarks, and search engine rankings keep working.
-
Will this affect my site’s SEO?
-
It shouldn’t hurt it — since the original URL redirects to the new one, search engines and existing backlinks continue to resolve correctly. Using clean, descriptive custom permalinks can also make your URLs more readable, which is generally good for SEO.
-
Yes. Custom Permalinks supports posts, pages, any public custom post type, and categories/tags (and other custom taxonomy terms).
-
Does it work with custom post types, like WooCommerce products?
-
Yes. You can set an individual custom permalink on any public custom post type, or define an automatic permalink structure for the entire post type from Custom Permalinks > Post Types Settings.
-
Is Custom Permalinks compatible with WPML or Polylang?
-
Yes, the plugin is compatible with both WPML and Polylang, including translated posts that each have their own custom permalink.
-
Can I use non-English characters in my permalinks?
-
Yes. Permalinks in non-Latin scripts, such as Arabic, Thai, Cyrillic, or Chinese, work as you type them. Browsers request these URLs percent-encoded, and Custom Permalinks matches them either way.
-
Where do the plugin’s translations come from?
-
From translate.wordpress.org. WordPress downloads them automatically for your site’s language. If the plugin shows in English on a translated site, update the translations from Dashboard > Updates. You can also help translate it there.
-
Can I let a non-administrator manage permalinks?
-
Yes. The plugin adds a dedicated Custom Permalinks Manager role (and matching capabilities) so you can let specific non-admin users view or edit permalinks without giving them full administrator access.
-
Can I use accented letters, uppercase letters, or extra hyphens in my permalinks?
-
By default, Custom Permalinks sanitizes permalinks the same way WordPress core does (lowercase, no accents, no repeated hyphens). Developers can lift these restrictions with the
custom_permalinks_allow_accents,custom_permalinks_allow_caps, andcustom_permalinks_redundant_hyphensfilters. See the Advanced Customization and Filters section on GitHub. -
A page builder’s front-end preview (Cornerstone, etc.) breaks or loses its editing mode on pages with a custom permalink
-
Some page builders load their live/front-end preview in an iframe using a
POSTrequest carrying special values the builder needs (for example Cornerstone’scs_preview_time). If that page also has a custom permalink, Custom Permalinks may redirect the request, and since redirects are followed asGET, the builder’sPOSTdata is lost and the preview breaks.You can tell Custom Permalinks to skip its redirect for that request with the
custom_permalinks_avoid_redirectfilter, added to your theme or a site-specific plugin:add_filter( 'custom_permalinks_avoid_redirect', function( $permalink ) { if ( isset( $_POST['cs_preview_time'] ) ) { // Adjust to match the field your builder sends. return true; } return false; } );See the Advanced Customization and Filters section on GitHub for this and other available filters.
-
What happens to my custom permalinks if I deactivate or uninstall the plugin?
-
Deactivating the plugin keeps all your saved custom permalinks in the database — reactivating it restores them immediately. Uninstalling (deleting) the plugin permanently removes all saved custom permalinks and plugin settings, and your URLs will revert to WordPress’ default permalink structure.
-
My custom permalink isn’t saving, or the page isn’t redirecting — what should I check?
-
- Make sure Settings > Permalinks isn’t set to “Plain”.
- Confirm no other SEO/redirection plugin (Yoast, RankMath, Redirection, etc.) has a conflicting rule for the same URL.
- Check that the permalink isn’t already used by another post — Custom Permalinks won’t apply a duplicate URL.
- Still stuck? See “Need Help or Found a Bug?” above, or reach out via GitHub or Premium support.
使用者評論
參與者及開發者
變更記錄
3.3.3 – Oct 13, 2026
- Bug:
- Fixed an infinite redirect loop on percent-encoded custom permalinks without a trailing slash (e.g. Japanese), a regression in 3.3.0.
3.3.2 – Oct 11, 2026
- Bug:
- Fixed custom permalinks in non-Latin scripts returning a 404 (e.g. Persian) when a shorter custom permalink matched the start of the URL (e.g. a
product/page forproduct/سلام/), a regression in 3.3.0. - Fixed custom permalinks in non-Latin scripts not loading with an endpoint appended (e.g.
/سلام/feed/).
- Fixed custom permalinks in non-Latin scripts returning a 404 (e.g. Persian) when a shorter custom permalink matched the start of the URL (e.g. a
3.3.1 – Oct 8, 2026
- Bug:
- Fixed the editor’s View Post and preview links not updating, or the wrong links being updated, after saving a custom permalink when the post’s previous URL contained characters such as
?,+or((e.g.?p=123for drafts). - Hardened the editor script to only update links with an http(s) URL on the site’s own domain.
- Fixed the editor’s View Post and preview links not updating, or the wrong links being updated, after saving a custom permalink when the post’s previous URL contained characters such as
- Accessibility:
- Added labels for screen readers to the checkboxes in Post Types Permalinks and Taxonomies Permalinks, the structure fields in Post Types Settings, and the Custom Permalink field on category, tag, and term screens.
- Raised the text contrast of the structure tags in Post Types Settings and of the plugin descriptions on the About screen, and underlined links in its text.
3.3.0 – Oct 8, 2026
- Changes to be aware of:
- Requires WordPress 5.9 and PHP 7.4 or later, the oldest versions the plugin is now tested on. Sites on older versions keep 3.2.1.
- Translations now come from translate.wordpress.org instead of files bundled with the plugin. It covers every bundled language and adds Serbian. Sites that installed the plugin outside wordpress.org, or turned off automatic translation updates, show English until the language pack is installed from Dashboard Updates.
- WPML translations now always resolve to their own custom permalink. Previously they returned another language’s custom permalink depending on the active (admin) language, which listed wrong URLs in Post Types Permalinks and in SEO plugins’ indexables and XML sitemaps (e.g. Yoast SEO).
%ctax_parents_TAXONOMY_NAME_name%now uses the parent terms’ names, as documented, instead of their slugs. Permalinks generated from now on change where a parent term’s name differs from its slug; saved permalinks are not changed.
- Redirects and URLs:
- Fixed custom permalinks in non-Latin scripts (e.g. Thai, Arabic, Cyrillic) returning a 404 or redirecting in an infinite loop, as the browser requests them percent-encoded while they are saved unencoded (or vice versa, depending on the site language).
- Fixed the trailing-slash redirect and the redirect to the custom permalink dropping the page number (e.g.
/news/page/2redirected to/news/instead of/news/page/2/). - Added the
custom_permalinks_disable_remove_page_numberfilter to keep the/page/{number}segment in the requested URL, for custom archive pages whose pagination doesn’t advance. - Fixed the query string being corrupted (e.g.
foo=barbecamehttp://foo=bar) after a custom permalink was resolved. - Fixed comment links on paginated comments (e.g.
/my-post/comment-page-2/) not following the custom permalink’s trailing slash, so a custom permalink without a trailing slash no longer gets comment URLs with one, and vice versa.
- WPML and Polylang:
- Fixed the WPML language switcher linking back to the current language instead of the translation when languages are in directories (e.g.
/en/,/de/) and the translation uses the same custom permalink. - Fixed WPML language directories that differ from the language code (e.g.
/de-de/forde, as in WPML 5.0) not being repaired when duplicated, and the default language getting its directory added to a permalink when “hide the default language directory” is on. - Fixed English custom permalinks not being lowercased and cleaned of special characters with WPML 5.0’s region-based language codes (e.g.
en-us). - Fixed Polylang translations sharing the same custom permalink (e.g.
/en/technologyand/zh/technology) redirecting to the other language when the translation’s stored language was missing or out of date.
- Fixed the WPML language switcher linking back to the current language instead of the translation when languages are in directories (e.g.
- Admin screens:
- Fixed Post Types and Taxonomies Permalinks pagination showing the first page’s results on every page, ignoring sorting and search, when a persistent object cache (e.g. Redis or Memcached) is enabled. The lists now also refresh right after a permalink is added, changed or deleted.
- Fixed bulk delete and search in Post Types and Taxonomies Permalinks failing with a “headers already sent” warning instead of redirecting.
- Fixed short titles and permalinks being padded with leading spaces in the Post Types and Taxonomies Permalinks lists.
- Fixed every post of a type showing and saving the same custom permalink when a theme or plugin runs a custom loop in the admin without resetting the global post.
- Fixed the original permalink showing as the custom permalink in the edit screen’s permalink box and in the block editor, and being compared against when saving a post or term.
- Fixed a fatal error on WordPress 5.9 and 6.0 when saving the Post Types Permalinks settings with the cache flush option, as
wp_cache_flush_group()needs WordPress 6.1. Object caches that can’t flush a single group now get a full cache flush. - Fixed the “Custom Permalinks Manager” role name not being translatable.
- Fixed Post Types Settings showing the WordPress address instead of the site address before each structure, which is wrong when WordPress is installed in a subdirectory.
- Compatibility:
- Fixed WooCommerce notices about accessing order data directly on order screens, as the permalink form read post fields from the
WC_Orderobject. - Fixed posts updated by WP All Import being handled as new posts, which turned permalink regeneration back on and could replace their custom permalink with the post type’s structure.
- Fixed the
seems_utf8()deprecation notice on WordPress 6.9 and later.
- Fixed WooCommerce notices about accessing order data directly on order screens, as the permalink form read post fields from the
Earlier versions
- For the changelog of earlier versions, please refer to the separate changelog.txt file.
