Support » Fixing WordPress » Categories hidden during writing/adding links

  • I’m using the built-in categories feature to tag posts and links. The problem I’ve come across is that on the ‘Write’ and ‘Add link’ pages, the categories list does not include categories that have posts of the opposite type.


    Categories: foo, bar, wibble
    foo has 1 post and 0 links
    bar has 0 posts and 1 link
    wibble has 0 posts and 0 links

    On the ‘Write Post’ page the categories will show foo and wibble.
    On the ‘Add Link’ page the categories will show bar and wibble.

    I want it to show all categories in all circumstances.

    I’ll be using these to add things like ‘related links’ to posts with the links which are in the same categories as the post.

Viewing 9 replies - 1 through 9 (of 9 total)
  • If a category is used by a post it doesn’t appear as a choice for links unless you manually add it by typing the Category in the dbx for a link.

    Once you’ve added it to a link it will then always appear in the box of Categories for links.

    I know that’s not what you want to hear but to do what you want would require some changes to core code and that’s not a good solution.

    You could always consider assigning all categories to one post and one link and then those categories would appear for future posts and links.

    Is there any way that a plugin could make this change rather than changing core code?

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Is there any way that a plugin could make this change rather than changing core code?


    I have tried your last suggestion of assigning the categories to one post and one link in various ways, but the categories get duplicated (with a new ID) if I type them in, and otherwise are not visible to the opposite (obviously).

    If a plugin would not be able to change this feature, is there something I can do in the database to tell the categories to be visible all the time?

    I don’t see the problem with assigning all categories to one post and all categories to one link to cause all categories to be listed (and available) in the category dbx of both posts and links.

    I took a new WordPress 2.1.3 install. Added two categories test1 and test2. Assigned both those categories to a link. Then in Write->Post, added those two categories and assigned to a post. After that test1 and test2 were available for both posts and categories.

    I’m having a very interesting time with this issue, because I happened to have had about 200 Post categories and about 400 Link categories. This is due to the old way that link categories and post categories were treated differently. Each post category had roughly two corresponding link categories. Needless to say, I would love to take advantage of the new category arrangement and merge all the categories that correspond to one another, whittling down the total number of categories from 600+ to slightly over 200.

    I just upgraded from WP v2.0.3 to WP v2.2, I was most dismayed to see what happened to my categories. When I tried to reclassify some of the links into post categories, they weren’t available as a choice. When I looked at the available choices for the post categories, though, the link categories were there. This is pretty frustrating, because I have way more posts than I do links, so I’m not about to port all my posts into link categories to get everything organized together.

    I found this forum thread, and tried to take MichaelH’s advice. I created a new link and put it in every single category available. As I picked each link category, I noticed that there were a few top-level post categories available to choose because they had no posts in themselves, just in their “children”. (my post categories are in a hierarchy about three levels deep in some cases). With this done, I created a new post and started to assign it to each category, but I found that the top-level post categories that were available on the “new link” screen were suddenly unavailable on the “new post” screen.

    I went back and deleted the “test” link. I went back to the test post, and for some reason even more categories were missing than before! I deleted the “test” post and started all over again from scratch with a new Test post. With a few exceptions, all of both the link categories and the post categories were available. I also made the new test link, and once again only the link categories are available.

    After all this, I think I can come to a few conclusions:

    – A post category will only be available as a link category if it has no posts already in it. It may have children with posts in them, however.

    – Making the test link with all available link categories before making a test post with all available post categories really messes up what post categories are available somehow.

    – Since I have a lot less work put into my links than in my posts (and since I’m no longer using all those freaking categories as I had originally intended), I’ll probably just extract the information from the links I have into posts and delete the links and the link categories, keeping link my link categories to a minimum in the future.

    That’s my upgrade/link/post/category saga. It’s an extreme case that I hope is helpful to others. If there are any WordPress gurus that have any further insight into some of the things that I tried, I would definitely appreciate it.


    I’m a newcomer to WordPress and I find it bizarre that this behaviour is considered ‘OK’. It is obviously a bug. This is old behaviour left over from shoving two different systems together. The situation benwisdom has should not exist. It took a lot of work to figure out why the category system was ‘broken’.

    Sorry Michael but this is a bug.

    I am running WP 2.22 and any category that has a link does not appear in the Category list for posts and the opposite is also true.

    Further, the category listing page has an error in it. I manually added a link with a category that has posts in it and the category page is not showing the link in the Links column of the Manage Categories page.

    This isn’t normal behavior and it is a bug.

    Moderator Samuel Wood (Otto)

    (@otto42) Admin

    Sorry, but it’s not a bug. It was intentional. I disagree with it personally, but it’s definitely intentional. We’ve had large arguments about it on the bug tracker and wp-hackers.

    Link and Post Categories are separate. There were attempts to combine them, but the attempts were half-hearted and a large number of developers hated the idea. So they remained partially separated.

    Wait, it gets worse: WordPress 2.3 sticks a large crowbar in there to separate them back apart again. Even worse, if you used a core hack to make them the same (like I did) then the 2.3 upgrade is going to break your system.

    I know, it sucks, but I was unable to convince any of the WP devs of the insanity of having separate categories.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘Categories hidden during writing/adding links’ is closed to new replies.