WordPress Plugin: Category Visibility
// March 8th, 2005 // Techie
I was using an old WordPress hack called Show Categories to get around the problem of my not wanting all posts of certain categories showing up on the front/main page. It worked…somewhat. But there were things it didn’t work on, such as feeds and sometimes searches and archive links. There are additional hacks I could do to fix that, but I thought instead that perhaps a new plugin was in order.
This plugin, which is very much in beta, only works in WordPress 1.5+. It adds a new menu link under the “Manage” admin menu titled “Category Visibility”. Once you activate the plugin, go to this menu and you’ll see the visibility settings for all categories. So far I’ve listed options for “Front”, “List”, “Search”, “Feed” and “Archives”, defined as:
- Front: All posts in the category will not show up on the main page
- List: The category will not show on the list of categories on the home page (i.e., the list in the sidebar here)
- Search: The category’s posts will not show up in search results
- Feed: The category’s posts will not show up in the main RSS/Atom feed
- Archive: The category’s posts will not show up in archive links (i.e., clicking on the calendar links)
I did not get a chance to test with inherited categories, so if that breaks let me know. I may get around to testing that sometime.
You can grab the latest version here (Version: 0.31)
NOTE: If you’re using the default download of WordPress version 1.5 (i.e., NOT 1.5.1 or above) download the version here. There’s a database change made in the nightlies that made this necessary for now.
IMPORTANT: As of version 0.28, these versions will create a new table and not use your existing one, so write down the current values if you’re using an older version of this plugin before installing and running this version!
To Do:
- Put this plugin on WP-Plugins.org (in progress)
- Allow per-post visibility option. Should be as simple as adding a custom field for posts.
- Fix issue with number of posts on front page when some are marked to not show up (i.e., you specify 10 posts per page, two of those are marked not to show on the front page, so you instead only see eight posts)



I’ve noticed this plugin causes problems with permalinks in WP2.0 Has anyone else experienced this problem? If so, is there a fix?
I modified Keith’s Category Visibility plugin somewhat for WP 2.0x.
I fixed the number of posts thing. And I believe the 2.0 permalinks problem is resolved. And a few other gotchas, like adding a new category but forgetting to go to CV to set the userlevel.
If you want to give it a try it’s at http://ryowebsite.com/?p=46
Hi.
I would just like to tell you your plugin works great for me in wordpress 2.0
The only thing i noticed is that when I add a new category from the “New Post” page, I have to go to the “Category Visibility” page and set the user level for the new category, or else the new category won’t be visible. It would be nice if the new category was visible by default, but I can live with it.
Good stuff.
How can I avoid that the plugin also stops the “pages” of the blog?
For me is very important!
Thanks!
PS: excuse for my English…
Hi, I’m having some errors during the configuring phase of wordpress plugin Category visibility. When I click on Category Visibility Button I have this kind of error (for 4 times):
WordPress database error: [You have an error in your SQL syntax near 'LIMIT 1' at line 1]
SELECT * FROM wp_cat_visibility WHERE cat_ID= LIMIT 1
If I try to uncheck a visibility for a categories of mine, I have many of the following error:
WordPress database error: [You have an error in your SQL syntax near ' front=1, list=1, search=1, feed=1, archives=1, user_level=0' at line 1]
REPLACE INTO wp_cat_visibility SET cat_ID=, front=1, list=1, search=1, feed=1, archives=1, user_level=0.
Am I missing anything ?
Thanks
Antonio
[...] I got hold of a WordPress plugin called “Category Visibility” version 0.31 by Keith McDuffee which was written for WordPress 1.5. It seems that no updates where made for WordPress 2.x and the search continued. There was a comment posted on the above listed website that linked to an updated version. It works very nice! [...]
[...] I’ve used a plug-in category_visibility by Keith McDuffee, to achieve this technical trickery. [...]
This plugin worked great on WP 1.5, but it broke my feed in 2.0.x. Looking forward to the update.
[...] For those who are curious, I’m using the built-in RSS widget to handle favorites, text widgets to handle the “About” and “Technorati” sidebar entries, and the Sideblog Plugin and widget to handle the “Asides.” This enabled me to dump all kinds of custom code which I had hacked into WordPress and the theme. I was also able to stop using Category Visibility (which, while nice, takes a bit of tweaking whenever one adds a new category). In addition, version 2 of the veryplaintxt theme added options like justifying the sidebar differently, which was great because along with its widget support I now have absolutely no reason to hack the theme at all. I can just upgrade and not worry (theoretically), or change themes and not worry, as long as the new theme supports widgets. [...]
Items from an invisible category show up in teh Next / Prev Item links. Otherwise the items disappear altogether and dont cause an embarrassment. How to fix this?
You rule! I love this pluggin
Hey thanks for this kickass plugin. I was stressing about unchecking the visible at front attribute producing a blank post instead of content. Fortunately, such a problem became a huge feature! My site has tutorials as well as news. I wanted these content feeds separate for the user. What I’ve done was created a tutorials page with tutorial post links and a tutorials category. I unchecked the list attribute for the tutorials category. Now traffic, wanting to see the list of tutorials will be diverted to a page list I’ve made instead of a category with all media content loaded! My tutorials will have lots of images and video, so you’d wonder how I’d prevent them from loading on the main page? I use the tag directly below my intro paragraph. This not only cuts the media from loading on the main page, but notifies users about the new tut. Thanks for this!
I’m on WP 1.5. I tried:
http://www.gudlyf.com/media/category_visibility-wp1.5.phps
and
http://www.gudlyf.com/media/category_visibility.phps (.31)
And both caused db errors. The first one caused errors on the admin side, the second one caused errors on the public side.
[...] Rich Hamilton’s revision of Keith McDuffee’s original “Category Visability” is an excellent WP plug-in. It just doesn’t quite work the way I needed for the main Moshav HaAm site, which has relatively sophisticated needs for layers of content access, given our mandate to be as open as possible to a number of different valences of community and leadership. [...]
This plugin appears to do most of what I would like it to do with one exception: I have the need for a subcategory to not only not show up on the main page but also not show up under the main category page as well.
i.e.,
Plants
+–general information
+–hints
This is not what I’m using but simply an example. In this case I wouldn’t want hints showing up under the category posts since hints would be a specific thing to look up and not something desired as a regular post. I would only want it showing up when the user specifically selects the hints subcategory.
I understand that may be a bit out of the ordinary but, in my case, very necessary.
Regards, Veg
HI!!
I recently downloaded your plugin today; however i am having problems with it. When I go to ‘Manage’ it doesn’t show me any options for the catagory visibility plugin. I’m not sure what i’m doing wrong. I have Owen Winkler’s “role manager” and i have the latest version of wordpress (20.5). Any help would be appreciated!!
Thanks again, for a wonderful plugin!
[...] Category Visability Hack Rich Hamilton’s revision of Keith McDuffee’s Category Visability is an excellent WP plug-in. It just doesn’t quite work the way we need for the new Moshav [...]
[...] quite happy with the upgrade. I have a couple of small hiccups and found a plugin that I couldn’t get to work. Luckily it was a minor plugin. Otherwise, no problems with the [...]
There some difference between this plugin and http://codex.wordpress.org/Plugins/Restriction Categories2Plugin
I would like to have how default all the categories
hidden;
can you suggest which is the cahnge that I must to do?
Now by default in admin all the categories are
checked and if you remove checked you can
hidden categories;
I would like to have the opposite:
I think there are two solutions:
-1 by default if all is checked then the categories
are hidden and if I remove check I can see it;
or
2 by default all isn’t checked and I not see
categories; only if I check I see categories;
I think found the parameter for to change but
have always problem that if one click same time button submit changes all checked switch at every
click;
can help
DS the plugin fit for WP 2.6.1?