Title: Remove CPT base
Author: kubiq
Published: <strong>2017 年 11 月 6 日</strong>
Last modified: 2025 年 12 月 1 日

---

搜尋外掛

![](https://ps.w.org/remove-cpt-base/assets/banner-772x250.png?rev=1759289)

![](https://ps.w.org/remove-cpt-base/assets/icon-256x256.png?rev=1759289)

# Remove CPT base

 由 [kubiq](https://profiles.wordpress.org/kubiq/) 開發

[下載](https://downloads.wordpress.org/plugin/remove-cpt-base.6.7.zip)

 * [詳細資料](https://tw.wordpress.org/plugins/remove-cpt-base/#description)
 * [使用者評論](https://tw.wordpress.org/plugins/remove-cpt-base/#reviews)
 *  [安裝方式](https://tw.wordpress.org/plugins/remove-cpt-base/#installation)
 * [開發資訊](https://tw.wordpress.org/plugins/remove-cpt-base/#developers)

 [技術支援](https://wordpress.org/support/plugin/remove-cpt-base/)

## 外掛說明

Remove custom post type base slug from url

 * possibility to select specific custom post type(s)
 * auto redirect old slugs to no-base slugs

### Yoast SEO specifics

If you’re using Yoast SEO plugin, after you change something in the Remove CPT base
plugin, you should deactivate Yoast SEO and activate it back again to refresh its
yoast_indexable database table, so it will generate correct og:url, canonical url
and JSON-LD urls.

## 安裝方式

 1. Upload `remove-cpt-base` directory to the `/wp-content/plugins/` directory
 2. Activate the plugin through the ‘Plugins’ menu in WordPress

## 使用者評論

![](https://secure.gravatar.com/avatar/e9ca1581a66ee96608258f42c1260f192ae4eeb5281ca238c6961d50789449cb?
s=60&d=retro&r=g)

### 󠀁[Works well!](https://wordpress.org/support/topic/works-well-3113/)󠁿

 [Konstantin Agafonov](https://profiles.wordpress.org/konstantin1agafonov/) 2025
年 10 月 22 日

Works well for me!

![](https://secure.gravatar.com/avatar/7315c567321ba9b67dd32712df8ba9c45335a19e53f755f0d748e452ade354f7?
s=60&d=retro&r=g)

### 󠀁[Very helpfull](https://wordpress.org/support/topic/very-helpfull-118/)󠁿

 [classikd](https://profiles.wordpress.org/classikd/) 2025 年 6 月 21 日

Thank for the plugin.I struggled for hours to make the plugin work with Polylang
and avoid 404s, for those who have the problem the solution is simple you have to
go in Polylang settings and check the “The front page url contains the language 
code instead of the page name or page id”, otherwise it will not work.

![](https://secure.gravatar.com/avatar/2ad809959fb7c1e8824ae3338f0ee87458a68cfee3fba9260dae7d29d60d8c9d?
s=60&d=retro&r=g)

### 󠀁[Works like a charm](https://wordpress.org/support/topic/works-like-a-charm-2325/)󠁿

 [Gregoire Noyelle](https://profiles.wordpress.org/aglekis/) 2024 年 5 月 16 日

Thanks a lot @kubiq

![](https://secure.gravatar.com/avatar/28c5f3cff8b39f99dd482db0bed1a36db4d9b0f2d471f477d68685dcbabf0683?
s=60&d=retro&r=g)

### 󠀁[Lifesaver!](https://wordpress.org/support/topic/lifesaver-256/)󠁿

 [Christian van ‘t Hof](https://profiles.wordpress.org/brightsol/) 2024 年 2 月 
23 日

Been looking for several solutions, and this works out of the box. Quick solution,
and extremely lightweight.

![](https://secure.gravatar.com/avatar/070ee7523afad5644676099dea2aa5861c08fbf333f5863196fa24bdf8a2da95?
s=60&d=retro&r=g)

### 󠀁[works perfect](https://wordpress.org/support/topic/works-perfect-1066/)󠁿

 [igitt23](https://profiles.wordpress.org/igitt23/) 2024 年 1 月 6 日

i tried so long to archive this by programming my own PHP snippets but wasnt able
to get to the right results. After searching long i finally found thi plugin in 
a reddit post and now it works perfect!

![](https://secure.gravatar.com/avatar/4cd5274face753626d20cf633533f4b74c0f0c4f64e21ec3d3986c7d19189bb4?
s=60&d=retro&r=g)

### 󠀁[Works Great](https://wordpress.org/support/topic/works-great-9063/)󠁿

 [Chris Cook](https://profiles.wordpress.org/cccamuseme/) 2023 年 12 月 6 日

Simple and to the point plugin that works. Thanks.

 [ 閱讀全部 33 則使用者評論 ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/)

## 參與者及開發者

以下人員參與了開源軟體〈Remove CPT base〉的開發相關工作。

參與者

 *   [ kubiq ](https://profiles.wordpress.org/kubiq/)

[將〈Remove CPT base〉外掛本地化為台灣繁體中文版](https://translate.wordpress.org/projects/wp-plugins/remove-cpt-base)

### 對開發相關資訊感興趣？

任何人均可[瀏覽程式碼](https://plugins.trac.wordpress.org/browser/remove-cpt-base/)、
查看 [SVN 存放庫](https://plugins.svn.wordpress.org/remove-cpt-base/)，或透過 [RSS](https://plugins.trac.wordpress.org/log/remove-cpt-base/?limit=100&mode=stop_on_copy&format=rss)
訂閱[開發記錄](https://plugins.trac.wordpress.org/log/remove-cpt-base/)。

## 變更記錄

#### 6.7

 * tested on WP 6.9

#### 6.6

 * tested on WP 6.7
 * fix PHP warning – make sure that post_type was not removed already
 * better HTTPS detection
 * use HTTP_HOST if SERVER_NAME is localhost – fix for kinsta hosting
 * new rcptb_current_url filter that you can use to modify output of the get_current_url
   function

#### 6.5

 * tested on WP 6.5

#### 6.4

 * tested on WP 6.4

#### 6.3

 * fix deprecated notice for PHP 8.2

#### 6.2

 * tested on WP 6.2
 * added Yoast SEO warning in the description

#### 6.1

 * tested on WP 6.1
 * use request hook instead of pre_get_posts to fix 404 in console

#### 6.0

 * fix for WPML hierarchical translated posts

#### 5.9

 * added nonce and security checks

#### 5.8

 * tested on WP 5.9

#### 5.7

 * tested on WP 5.5
 * minor fix

#### 5.6

 * tested again with WPML, Polylang and Custom Post Type Permalinks and fixed

#### 5.5

 * tested on WP 5.5
 * another fix for Custom Post Type Permalinks plugin

#### 5.4

 * enable previews for CPTs without base

#### 5.3

 * make it works with WPML
 * make it works with Polylang
 * make it works with Custom Post Type Permalinks plugin

#### 5.2

 * tested on WP 5.4

#### 5.1

 * removed auto-prevent slug duplicates
 * removed debug mode
 * removed remove_cpt_base_skip filter
 * use default WP function instead of custom
 * make it works for custom rewrite slugs
 * prioritize page and post like WP does

#### 5.0

 * YOU HAVE TO SAVE YOUR SETTINGS AGAIN, because:
 * added alternation option for each post type separately
 * added debug mode

#### 4.8

 * fix alternative CPT children solving for nested children

#### 4.7

 * alternative CPT children solving

#### 4.6

 * fix server port redirect

#### 4.5

 * make it works for WP installations in directory

#### 4.4

 * minor changes

#### 4.3

 * fix for some endpoints and make sure post is not interpreted as attachment

#### 4.2

 * fix for hierarchical CPTs on some servers

#### 4.1

 * make it works for posts interpreted like category by WP

#### 4.0

 * tested on WP 5.2
 * make it works for hierarchical post types and different permalink structures
 * going back to ‘pre_get_posts’
 * optimize generating slug for duplicate names

#### 3.3

 * change HTTP code from 404 to 200

#### 3.2

 * fix for query strings

#### 3.1

 * add custom endpoint rewrites support

#### 3.0

 * stop using complicated ‘pre_get_posts’ and handle 404 instead

#### 2.3

 * tested on WP 5.0

#### 2.2

 * fix 404

#### 2.1

 * fix redirect loop in WPML and WooCommerce

#### 2.0

 * stop using .htaccess rules

#### 1.2

 * auto init after permalinks updated

#### 1.1

 * add uninstall hook
 * add duplicate slug check
 * minor updates

#### 1.0

 * First version

## 中繼資料

 *  版本 **6.7**
 *  最後更新 **5 個月前**
 *  啟用安裝數 **10,000+**
 *  WordPress 版本需求 ** 3.0 或更新版本 **
 *  已測試相容的 WordPress 版本 **6.9.4**
 *  PHP 版本需求 ** 5.6 或更新版本 **
 *  語言
 * [English (US)](https://wordpress.org/plugins/remove-cpt-base/)
 * 標籤
 * [BASE](https://tw.wordpress.org/plugins/tags/base/)[custom post type](https://tw.wordpress.org/plugins/tags/custom-post-type/)
   [permalink](https://tw.wordpress.org/plugins/tags/permalink/)[remove](https://tw.wordpress.org/plugins/tags/remove/)
   [slug](https://tw.wordpress.org/plugins/tags/slug/)
 *  [進階檢視](https://tw.wordpress.org/plugins/remove-cpt-base/advanced/)

## 評分

 5 星，滿分為 5 星

 *  [  32 個 5 星使用者評論     ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/?filter=5)
 *  [  1 個 4 星使用者評論     ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/?filter=4)
 *  [  0 個 3 星使用者評論     ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/?filter=3)
 *  [  0 個 2 星使用者評論     ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/?filter=2)
 *  [  0 個 1 星使用者評論     ](https://wordpress.org/support/plugin/remove-cpt-base/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/remove-cpt-base/reviews/#new-post)

[查看全部使用者評論](https://wordpress.org/support/plugin/remove-cpt-base/reviews/)

## 參與者

 *   [ kubiq ](https://profiles.wordpress.org/kubiq/)

## 技術支援

最近 2 個月解決的問題:

     總計 1 個問題，已解決 0 個

 [檢視技術支援論壇](https://wordpress.org/support/plugin/remove-cpt-base/)

## 贊助

想要支援這個外掛的發展嗎？

 [ 贊助這個外掛 ](https://www.paypal.me/jakubnovaksl)