Support » Plugin: Custom Post Type UI » Converting a standard Post Category to a CPT

  • Resolved luthermax

    (@luthermax)


    I would like to ‘convert’ standard posts of a particular category to be a custom post type instead. The new post type will have the same name as the old category.

    Is this possible or will the name cause a conflict due to URL slug?

Viewing 7 replies - 1 through 7 (of 7 total)
  • Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Biggest way I could potentially see conflicts is if somehow the post type permalinks are meant to have /category/ in them too.

    mysite.com/category/some-category/ is going to look for the some-category term and list all the standard posts with that category. Same things for mysite.com/category/some-category/child-category/ with that term’s archive.

    However, if you name the post type some-category and then have a post in that post type named child-category, then you’d end up with a permalink of mysite.com/some-category/child-category/ and no real conflict. If you need the single post permalink to still be mysite.com/category/some-category/child-category/, that’s where the conflict would arise most.

    Thread Starter luthermax

    (@luthermax)

    Hi Michael,

    Thanks for getting back to me!

    The site is currently set to include the category in the permalink (to achieve the same effect with standard posts as if they were a custom post type).

    But I can disable that in the permalink structure.

    But having a core post category with the same name shouldn’t prevent me from *creating* a post type with that same name?

    As long as I can do that, I guess I can remove the category from the permalink structure and use a post type conversion plugin to change the posts in the category to be posts in the new post type with no category.

    Another thing that’s very important is retaining the comments attached to each post!

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    At least with CPTUI, we don’t attempt preventing based on category term slugs, so we’re not actively preventing you from creating a post type of the same term slug/name.

    Regarding comments. just need to change the post type slug for the given posts in question, and you’re likely golden.

    I’m most worried about potential permalinks than anything else.

    Thread Starter luthermax

    (@luthermax)

    I think I’ve got it sorted.

    The posts only have one category, so I can convert them to the new post type without a category.

    So:

    /category-name/

    will become:

    /post-type-name/

    But in practice the two slugs will be the same.

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    My hunches are that you’re going to be just fine.

    Thread Starter luthermax

    (@luthermax)

    I did the necessary redirects and it seemed to work fine.

    Thanks for your help!

    Plugin Author Michael Beckwith

    (@tw2113)

    The BenchPresser

    Welcome.

Viewing 7 replies - 1 through 7 (of 7 total)
  • The topic ‘Converting a standard Post Category to a CPT’ is closed to new replies.