WordPress.org

Ready to get started?Download WordPress

Forums

More Types
Using categories in permalink (5 posts)

  1. ajuliano
    Member
    Posted 3 years ago #

    I want to use the posts category in the permalink.

    http://mysite.com/categoryname/postname

    I tried to do it by writing: %category%/
    In the Permalink base field.

    Any ideas?

    http://wordpress.org/extend/plugins/more-types/

  2. kwbridge
    Member
    Posted 3 years ago #

    You would add this to the custom structure field

    /%category%/%postname%/

  3. ajuliano
    Member
    Posted 3 years ago #

    I went to
    'Settings' -> 'Permalinks'
    added /%category%/%postname%/ to the 'custom structure field'.

    That worked for my default posts, but not for my custom post types.

    What I thought would work:
    Go to:
    'Settings' -> 'More Types'
    'Edit' - my post type
    'Advanced Settings'
    Add /%category%/%postname%/ to 'Permalink base'.

    But it is not working. The permalink is showing: http://mysite.com//%category%/%postname%//the-real-post-name

    Doesn't this plugin support that feature? Or am I doing something wrong?

    Thanks!

  4. ctraganos
    Member
    Posted 3 years ago #

    I have the same issue

  5. ajuliano
    Member
    Posted 3 years ago #

    I found out that it's not a good thing to use the category in the permalink structure. And I think that's why More Fields doesn't support it.

    From the Codex http://codex.wordpress.org/Using_Permalinks#Structure_Tags

    For performance reasons, it is not a good idea to start your permalink structure with the category, tag, author, or postname fields. The reason is that these are text fields, and using them at the beginning of your permalink structure it takes more time for WordPress to distinguish your Post URLs from Page URLs (which always use the text "page slug" as the URL), and to compensate, WordPress stores a lot of extra information in its database (so much that sites with lots of Pages have experienced difficulties). So, it is best to have at least two path segments in your post's permalink structure such as /%year%/%post_name%/ or even /posts/%post_name/. (Some people recommend /%post_id%/%post_name%/ which works for performance reasons but others recommend against it because it is unfriendly to users in the many contexts in which users interact with URLs.) See Otto's technical writeup on the topic as well as this wp-testers discussion.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags