• I see in other places that permalinks generated from a category, or nested categories behave according to the id of the categories in question. The recommendation seems to be to go in and edit the wp_terms table directly until you get the behaviour you want.

    That seems pretty bad IMO, but nevertheless the question is will altering the id’s of categories there affect existing content or will everything stay labelled as it was originally?

    Is there any plugin out there that manages this for you?

Viewing 8 replies - 1 through 8 (of 8 total)
  • permalinks generated from a category, or nested categories behave according to the id of the categories in question

    Sorry? Can you elaborate on that?

    The recommendation seems to be to go in and edit the wp_terms table directly

    What recommendation where?

    Thread Starter Martyn_

    (@martyn_)

    References:

    http://wordpress.org/support/topic/subcategories-not-showing-up-in-uri-with-pretty-permalinks?replies=5

    Whist the woedpress codex http://codex.wordpress.org/Using_Permalinks states:

    “When you assign multiple categories to a post, only one can show up in the permalink. This will be the lowest numbered category (see Manage Categories). The post will still be accessible through all the categories as normal.”

    But fails to provide a means of acheiving the required numbering – the dashboard interface for managing categories makes no mention of the associated number.

    Thread Starter Martyn_

    (@martyn_)

    @esmi Thanks. However the question isn’t really how to find them – I know that the order they are in breaks what I want to do. the question is how to fix it in a sane way – the consequences of switching them with a db editor are unclear (and using a db editor directly quite frankly gives me the heeby jeebies anyway).

    Is it better to create a new category structure and try something like http://wordpress.org/plugins/bulk-move/ ? Would that be a safer approach?

    Should WP not provide a bulk move function if the category ID is so hardwired to how the site behaves?

    the consequences of switching them with a db editor

    Just don’t go there! You’re far more likely to totally wreck your site. The WordPress database uses relational tables, so any given category id is used across multiple tables.

    Would that be a safer approach?

    Infinitely safer.

    Should WP not provide a bulk move function if the category ID is so hardwired to how the site behaves?

    Sorry?. I don’t follow your phrase “the category ID is so hardwired to how the site behaves? Can you elaborate? Maybe it would help if you described the problem you currently have?

    Thread Starter Martyn_

    (@martyn_)

    OK the problem:

    I have a populated site with one default category (A) and a permalink structure using %category%. I want to add a second category (B) (whether a child or not makes no difference here). Initially all posts are in A, and new posts might be in A,B, or Both. The behaviour I observe;

    If a post is in A the permalink is /A.
    If a post is ONLY in B the permalink is in /B
    If a post is in A and B the permalink is in /A (I want /B here).

    If I make B a child of A the permalink is always A (It should be /A/B)

    In order to make an A+B post appear with permalink B, the ID order of the categories needs reversing. WordPress provides no tool for doing that, or migrating posts between categories, so with out an external tool I am stuffed.

    I would suggest that the requirement for ID ordering to properly represent a hierarchical permalink is a bug – the site should not behave differently based on the ID values of the categories, but solely on the hierarchy defined in the dashboard. In the case of a flat structure, WP provides no tools for changing the behaviour as to which category takes priority in determining the permalink because its using a DB key which can’t be changed.

    I hope that makes sense!

    The reason for needing this change on my site is because some tools and a fair few wordpress plugins use directory based controls.

    f a post is in A the permalink is /A.
    If a post is ONLY in B the permalink is in /B
    If a post is in A and B the permalink is in /A (I want /B here).

    That’s not possible. As A is the oldest category, it has the lowest category id and will always be displayed when a post is filed under A & B. If you want the permalink to show B, then just file the post under B.

    I would suggest that the requirement for ID ordering to properly represent a hierarchical permalink is a bug

    It is not a bug. It is part of WordPress core & is by design.

    Thread Starter Martyn_

    (@martyn_)

    Bug or design deficiency. The behaviour makes it impossible to amend the way a site works after its initially constructed – that is poor design.

    I can see other people running into this with google, so I would appreciate to hear what others think…

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Category ID's and permalinks.’ is closed to new replies.