Title: Single Category Permalink
Author: Scott Reilly
Published: <strong>2011년 7월 18일</strong>
Last modified: 2021년 9월 29일

---

플러그인 검색

![](https://ps.w.org/single-category-permalink/assets/banner-772x250.png?rev=845064)

이 플러그인은 **최근 3개의 주요 워드프레스 출시와 시험 되지 않았습니다**. 워드프레스의
좀 더 최근 버전으로 이용할 때 더 이상 관리되지 않고 지원되지 않고 호환성 문제가 
있을 수 있습니다.

![](https://ps.w.org/single-category-permalink/assets/icon-128x128.png?rev=1092767)

# Single Category Permalink

 작성자: [Scott Reilly](https://profiles.wordpress.org/coffee2code/)

[다운로드](https://downloads.wordpress.org/plugin/single-category-permalink.2.5.2.zip)

 * [세부사항](https://ko.wordpress.org/plugins/single-category-permalink/#description)
 * [평가](https://ko.wordpress.org/plugins/single-category-permalink/#reviews)
 *  [설치](https://ko.wordpress.org/plugins/single-category-permalink/#installation)
 * [개발](https://ko.wordpress.org/plugins/single-category-permalink/#developers)

 [지원](https://wordpress.org/support/plugin/single-category-permalink/)

## 설명

Reduce permalinks (category or post) that include entire hierarchy of categories
to just having the lowest category in the hierarchy.

By default, WordPress replaces the %category% permalink tag in a custom permalink
structure with the entire hierarchy of categories for the post’s first matching 
category. For example, assuming your site has a hierarchical category structure 
like so:

    ```
    Applications
      |_ Desktop
      |_ Web
        |_ WordPress
    ```

By default, if you have a permalink structure defined as `%category%/%year%/%monthnum%/%
day%/%postname%`, your post titled “Best Plugins” assigned to the “WordPress” category
would have a permalink of:

    ```
    https://www.example.com/applications/web/wordpress/2008/01/15/best-plugins
    ```

If you activate the Single Category Permalink plugin, this would be the permalink
generated for the post (and recognized by the blog):

    ```
    https://www.example.com/wordpress/2008/01/15/best-plugins
    ```

In order for a category to be used as part of a post’s permalink structure, `%category%`
must be explicitly defined in the Settings -> Permalinks admin page as part of a
custom structure, i.e. `/%category%/%postname%`.

For category links, `%category%` is implied to follow the value set as the “Category
base” (or the default category base if none is specified). So if your category base
is ‘category’, the above example would list posts in the ‘WordPress’ category on
this category listing page:

    ```
    https://www.example.com/category/applications/web/wordpress/
    ```

With this plugin activated, that link would become:

    ```
    https://www.example.com/category/wordpress/
    ```

NOTE: The fully hierarchical category and post permalinks will continue to work.
The plugin issues a 302 redirect to browsers and search engines pointing them to
the shorter URL.

Links: [Plugin Homepage](https://coffee2code.com/wp-plugins/single-category-permalink/)
| [Plugin Directory Page](https://wordpress.org/plugins/single-category-permalink/)
| [GitHub](https://github.com/coffee2code/single-category-permalink/) | [Author Homepage](https://coffee2code.com)

### Hooks

The plugin exposes one filter for hooking. Code using this filter should ideally
be put into a mu-plugin or site-specific plugin (which is beyond the scope of this
readme to explain). Less ideally, you could put them in your active theme’s functions.
php file.

**c2c_single_category_redirect_status (filter)**

The ‘c2c_single_category_redirect_status’ hook allows you to specify an HTTP status
code used for the redirect. By default this is 302.

Arguments:

 * $status (integer) : The default HTTP status code

Example:

    ```
    /**
     * Change the redirection HTTP status to a 302.
     *
     * @param  int $code The HTTP status code. By default 301.
     * @return int
     */
    function scp_change_redirect_status( $code ) {
        return 302;
    }
    add_filter( 'c2c_single_category_redirect_status', 'scp_change_redirect_status' );
    ```

## 설치

 1. Install via the built-in WordPress plugin installer. Or download and unzip `single-
    category-permalinks.zip` inside the plugins directory for your site (typically `
    wp-content/plugins/`)
 2. Activate the plugin through the ‘Plugins’ admin menu in WordPress
 3. Use `%category%` as a permalink tag in the `Settings` -> `Permalinks` admin options
    page when defining a custom permalink structure

## FAQ

### Will existing links to my site that used the full category hierarchy still work?

Yes, WordPress will still serve the category listings and posts regardless of whether
it is of the full category hierarchy format or just the single category format. 
But do note that WordPress doesn’t perform any sort of redirects; it responds directly
to the category/post URL requested.

### Could this give the appearance that I have duplicate content on my site if pages are accessible via the full category hierarchy permalink format and the single category permalink format?

Whether this plugin is active or not, WordPress treats both types of category links
the same. This plugin will however issue redirects for all of the non-canonical 
category and post permalink pages to point to the single category link version.

### What can this plugin do for me if I don’t use `%category%` in my custom permalink structure?

In addition to handling custom permalink structures (used to generate permalinks
for posts) that contain `%category%`, the plugin also shortens category archive 
links. WordPress by default generates those links in a fully hierarchical fashion
which this plugin will reduce to a single category. See the Description section 
for an example.

### Does this plugin include unit tests?

Yes.

## 후기

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

### 󠀁[nice plugins](https://wordpress.org/support/topic/nice-plugins-47/)󠁿

 [hangtotnenmua](https://profiles.wordpress.org/hangtotnenmua/) 2021년 1월 15일

nice plugins! i love you! chup chup

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

### 󠀁[Unstopable Thanks](https://wordpress.org/support/topic/unstopable-thanks/)󠁿

 [Rabby](https://profiles.wordpress.org/mynameisrabby/) 2020년 1월 18일

Unstopable thanks, So far it can be said. This tiny plugin is very very helpful 
to make good url structure for big site, which is huge category and sub-category.[
Note: I’m not good at English so much]

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

### 󠀁[Great plugin!](https://wordpress.org/support/topic/great-plugin-18009/)󠁿

 [dandeedo](https://profiles.wordpress.org/dandeedo/) 2018년 5월 17일

gives you full control of your category permalinks… Really great plugin, works well!

 [ 모든 5 평가 읽기 ](https://wordpress.org/support/plugin/single-category-permalink/reviews/)

## 기여자 & 개발자

“Single Category Permalink”(은)는 오픈 소스 소프트웨어입니다. 다음의 사람들이 이
플러그인에 기여하였습니다.

기여자

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

[자국어로 “Single Category Permalink”(을)를 번역하세요.](https://translate.wordpress.org/projects/wp-plugins/single-category-permalink)

### 개발에 관심이 있으십니까?

[코드 탐색하기](https://plugins.trac.wordpress.org/browser/single-category-permalink/)
는, [SVN 저장소](https://plugins.svn.wordpress.org/single-category-permalink/)를
확인하시거나, [개발 기록](https://plugins.trac.wordpress.org/log/single-category-permalink/)
을 [RSS](https://plugins.trac.wordpress.org/log/single-category-permalink/?limit=100&mode=stop_on_copy&format=rss)
로 구독하세요.

## 변경이력

#### 2.5.2 (2021-09-28)

 * Change: Note compatibility through WP 5.8+
 * Unit tests:
    - Change: Restructure unit test directories
       * Change: Move `phpunit/bin/` into `tests/`
       * Change: Move `phpunit/` into `tests/`
    - Change: Remove ‘test-‘ prefix from unit test file
    - Change: In bootstrap, store path to plugin file constant
    - Change: In bootstrap, add backcompat for PHPUnit pre-v6.0

#### 2.5.1 (2021-04-30)

 * Change: Note compatibility through WP 5.7+
 * Change: Update copyright date (2021)

#### 2.5 (2020-09-23)

 * Fix: Default the `$taxonomy` argument of `category_link()` to ‘category’ to avoid
   a PHP warning/error
 * Fix: Handle the possibility that `get_category()` could return `null` for an 
   invalid category ID
 * New: Add a TODO item about removing deprecated functions (which is not something
   I want to do just yet, hence the TODO)
 * Change: Update docs for return value of `category_link()` to reflect that `WP_Error`
   or `null` are also possible values
 * Change: Note compatibility through WP 5.5+
 * Change: Restructure unit test file structure
    - New: Create new subdirectory `phpunit/` to house all files related to unit
      testing
    - Change: Move `bin/` to `phpunit/bin/`
    - Change: Move `tests/bootstrap.php` to `phpunit/`
    - Change: Move `tests/` to `phpunit/tests/`
    - Change: Rename `phpunit.xml` to `phpunit.xml.dist` per best practices
 * Unit tests:
    - New: Add tests for `category_link()`, `post_link()`
    - New: Add `unset_permalink_structures()` to unset configured permalink structures

_Full changelog is available in [CHANGELOG.md](https://github.com/coffee2code/single-category-permalink/blob/master/CHANGELOG.md)._

## 기초

 *  버전 **2.5.2**
 *  최근 업데이트: **5년 전**
 *  활성화된 설치 **400+**
 *  워드프레스 버전 ** 4.6 또는 그 이상 **
 *  다음까지 시험됨: **5.8.15**
 *  언어
 * [English (US)](https://wordpress.org/plugins/single-category-permalink/)
 * 태그:
 * [category](https://ko.wordpress.org/plugins/tags/category/)[coffee2code](https://ko.wordpress.org/plugins/tags/coffee2code/)
   [link](https://ko.wordpress.org/plugins/tags/link/)[permalink](https://ko.wordpress.org/plugins/tags/permalink/)
   [structure](https://ko.wordpress.org/plugins/tags/structure/)
 *  [고급 보기](https://ko.wordpress.org/plugins/single-category-permalink/advanced/)

## 평점

 별 5점 만점에 5점.

 *  [  5/5-별점 후기     ](https://wordpress.org/support/plugin/single-category-permalink/reviews/?filter=5)
 *  [  0/4-별점 후기     ](https://wordpress.org/support/plugin/single-category-permalink/reviews/?filter=4)
 *  [  0/3-별점 후기     ](https://wordpress.org/support/plugin/single-category-permalink/reviews/?filter=3)
 *  [  0/2-별점 후기     ](https://wordpress.org/support/plugin/single-category-permalink/reviews/?filter=2)
 *  [  0/1-별점 후기     ](https://wordpress.org/support/plugin/single-category-permalink/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/single-category-permalink/reviews/#new-post)

[모든  리뷰 보기](https://wordpress.org/support/plugin/single-category-permalink/reviews/)

## 기여자

 *   [ Scott Reilly ](https://profiles.wordpress.org/coffee2code/)

## 지원

할 말 있으신가요? 도움이 필요하신가요?

 [지원 포럼 보기](https://wordpress.org/support/plugin/single-category-permalink/)

## 기부

이 플러그인이 발전하도록 도우시겠습니까?

 [ 이 플러그인에 기부하기 ](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=6ARCFJ9TX3522)