RYO ‘Category Visibility’ WordPress Plugin
I needed a plugin that would display Posts only from certain categories. I found an earlier version of this plugin and modified it for my needs; then I supercharged it. Now I’m sharing it with you.
Beta test version available.
A good example of Category Visibility is this very website. It’s original purpose (in 2005) was to serve my web customers, most of whom wouldn’t have any idea how to install a plugin. I didn’t want plugin Posts to show to my regular users, but wanted to make the plugins available to other WordPress users who would want them.
See all of our WordPress Plugins
I created a WP Plugins category and unchecked “Front” and “List.” This kept these Posts off the home page, and the listing off the sidebar. (That’s all changed now. Users have a much greater understanding of plugins!)
The “WordPress Plugins” link above illustrates the point. It’s a link to the category page, which lists the plugins. You can see the category page and the associated Posts just fine. But that category did not show up in the sidebar, or on the home page. (It does now.)
This way, you could get access, in fact, anyone can search for them and find them. But they were not “out there” on the home page or in category links in the sidebar bothering my regular users.
Screenshot

History
I was using a WordPress plugin called Category Visibility (Keith McDuffee) which was written for WordPress 1.5.
It had a few odd points like when it filtered posts off the Home Page that was okay but it didn’t replace them; that is, if your front page was supposed to show 10 posts and two were filtered out, you’d only get eight posts. I fixed that and a few other tricky things.
It was wonderful, and lots of users agreed. Then WordPress 2.1 came out and broke everything. So I stuck with WP 2.0 for a long time.
No more! I woke in the middle of the night with an idea on how to re-think the logic and rewrite the whole thing from scratch. The new approach is more concise and takes fewer resources.
The result is faster, leaner, and, I hope, more likely to work with newer versions of WP. The same, familiar interface. Far more efficient.
Multiple categories on a post? Fine. The plugin tells WP which categories to exclude. This might not always be what you want. But it’s how it works.
There’s no upgrade path. If you’re using an older Category Visibility from one of the folks who tried to upgrade the old code, uninstall that first.
Instructions
Simply download and unzip it.
Put it in your plugins directory.
Activate it.
Go to Settings, RYO Category Visibility to see the visibility settings for all categories. the options are:
- Front: Posts show up on the main (home) page.
- List: Categories that will show up in the List of categories in the sidebar.
- Search: Posts show up in search results.
- Feed: Posts show up in the main RSS/Atom feed.
- Archive: Posts show up in archive pages (i.e., clicking on the calendar links).
- User Level: Numeric user level required to see these Posts.
Everything is checked to show up by default.
When you have a category to exclude from the front page, or the sidebar, etc., go to “Manage,” “Category Visibility,” and deselect the areas where you want the category to disappear.
This method is not designed as a security device, only as a display method. A guest can still access a post by post number.
Download
Download Beta Test Version for WP 2.8.x-3.0:
Ver. 3.0beta-7.Currently in beta. It seems to be working on my website running 3.0.1. May work on older versions as far back as 2.3. How about yours? Beta .02 adds User Level control as in the original. Beta .03 corrects for compatibility with some other plugins. Beta .04 corrects for an initialization problem with some php installations and moves the options page to Settings. Beyond that just a few tweaks. Just about ready for prime time, eh?
Legacy version, WP 2.0.x: Ver. 1.0.0e. This plugin version only works in WordPress 2.0.






Wait, most are saying it does not work. One person says it does work (resim) and one saying they managed to fix it.
My site design depends on this plugin, so i’m gonna have to be sure its working before I upgrade to 2.3. ;)
WordPress 2.3 handles categories differently. They are don’t have their own table in the database anymore. This plugin won’t work with 2.3 until somebody fixes it.
If you have a fixed version can you please post the updates here.
(…still waiting for the WP2.3 fixed version…)
Here is the link to a working version!!
http://www.tastycornbread.com/category-plugin/
Enjoy!
..waiting for the WP2.3 fixed version) too
please fix it :)
Thanks to ProjektSeven for getting this (mostly) working on WordPress 2.3 (found here). It will work for what I need on http://www.ponderplace.com. :)
Also, for whatever reason ProjektSeven does not give a description or any explanation on his/her/their website. The following can be found in the plugin’s .php file.
“WordPress veritabanı hatası: [You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY post_date DESC' at line 1] SELECT wp_posts.* FROM wp_posts WHERE 1=1 AND ID = 9 AND (post_type = ‘post’) AND ((wp_catt_visibility.archives=1 AND wp_catt_visibility.cv_user_level<=’0′) OR post_type=’page’ OR wp_catt_visibility.catt_ID IS NULL ORDER BY post_date DESC “
i have this problem what can i do????
ACK! Why in the hell isn’t this feature standard with WordPress?!
Demir21, kulladığın WordPress sürümü 2.3 değil ise http://ryowebsite.com/wp-content/catvis-2.1beta9.zip kullan, bu hata o zaman çıkmaz.
Thank you very much, i’m going to impliment this right away. Been looking for this for hours, totally grateful.
Marty.
Hi everybody! I noticed that ProjektSeven’s changes did not work on my latest wp installation ver 2.3.1 But I found another plugin that works and does pretty much the same thing over here: http://wordpress.org/extend/plugins/advanced-category-excluder/
Hope this is helpful to someone :o)
Hi there,
I get an error after installing and activating the plugin. After I activate I get this message appearing at the top of my website:
WordPress database error: [Table 'gogreen.wp_post2cat' doesn't exist]….
…this continues with lots more code.
I also get the same code displaying where my category links should display.
In the Admin, on the Category Visibility page I get this:
WordPress database error: [Table 'gogreen.wp_categories' doesn't exist] SELECT * FROM wp_categories ORDER BY cat_name
I’m using 2.3.1 and I get the same message with your latest version and your beta 10 version. Any ideas?
Thanks for your help by the way.
P.S if you want me to email you the rest of the code let e know.
ChrisJB: This plugin is for WP 2.0.
NOT for 2.1, 2.2,2.3 or anything later. Some folks might find it workable for their situation. Most won’t.
Check out http://www.tastycornbread.com/category-plugin/ Updated for 2.3!
Thanks Atreus I’ll check that out.
That worked a treat Altreus! Thanks very much.
I installed the plugin from http://www.tastycornbread.com/category-plugin/. A blank page appear when I click on manage > Category Visibility. Any idea whats going on or any area I need to configure? Btw I am currently using wp2.3.1….
it is not working on wp2.3 but i will try other plugin.
I hope you keep this plugin going as it rocks. Anyone getting it working in 2.3.1?
Hello,
I have instaled this plugin http://www.tastycornbread.com/category-plugin/ but it does not hide one of my categories from homepage. Any advice?
Thank you for reply!
WHEN ITS GOIN´ TO WORK ON wp 2.3 !
PLEASE, WORK ON THAT MASTAH
It’s NOT going to work on 2.3. Period. Because development has stopped. It’s here for those who use compatible versions.
(YOU could always download it and REVISE IT YOURSELF to work.)
The http://www.tastycornbread.com/category-plugin/ link is now dead.. does anyone have a copy of that plugin that they could post up somewhere?
Thanks..
bs
I downloaded this plugin. Thank you.
Does any one have a LINK for a version that works with WP 2.3 ?
Hi there,
Is it possible to use your plugin to restrict a wordpress user from selecting a certain category when making a post?
Regards,
Leigh.
Leigh,
I think not.
I have one but I have been dragging my feet in posting it, because it is not fully bug tested. I’ll put it up tonight though.
It is up, download and watch for updates here. http://ipeat.com/?page_id=91
Great plugin.
However, I can’t get 1.0.0e to work with the Filosofo Home Page Control plugin – e.g. see http://www.wolverhamptonclc.co.uk/blog. This is set as the blog section in Home Page control options, and the categories “News” and “Podcast” hidden from Front in options for Category Visibility.
However, those categories still show on the blog page.
Any ideas for how I can get it to work?
Sorted my own problem:
I replaced:
if (is_home())
on line 245 with
if (!is_archive()&& !is_category() && !is_feed() && !is_search() &&!is_single())
i.e. Use a process of elimination to identify the front page.
hi there.com plugin but :
Does anybody know if tis script is compatible with WordPress 2.5?
Thanks in advance for any help on this!
turkbaron
The original plugin is used with WP 2.0.x only… not later versions.
But we’ve just started updating with a version for 2.8+. It may work on somewhat older versions, maybe as far back as 2.3, though I recommend updating to 2.8 or later for security reasons.
You’ll have to tell me where it works. Try it out!
[...] his plugin, giving my plugin life, has decided to get back in the game. So go check it out http://ryowebsite.com/wp-plugins/category-visibility/ . If you using older versions of wordpress, mine will still be available. Back to Top Tags: [...]
Hello,
I used this plugin before and it’s great! Now i am building another website. On this website the plugin also works fine, almost. The wordpress galleries will not show anymore. For the galleries i use the cleaner gallery plugin which uses the build-in WordPress gallery functionality.
I don’t know what the problem is. Could you help me? Thx!
Greets, Gert.
Gert, If you deactivate the Cleaner Gallery plugin, do the galleries come back? Which version of WP are you using? Are you trying to load images from a different Post that’s hidden?
Thank you Owner very Good
Hello Rich,
Thank you for the quick response. 1. If you deactivate the Cleaner Gallery plugin, do the galleries come back? No, I deactivated the cleaner Gallery and the gallery did not come back. 2. Which version of WP are you using? Version 2.8.5 3. Are you trying to load images from a different Post that’s hidden? I uploaded the files using the flash-uploader. Uploading the files directly from my computer. The only thing that is in my post is [gallery]. I also have featured articles on my website. These articles are in the category ‘Featured articles’. Hiding this category does not affect displaying the post on the main page.
The post does show an image on its own.
Maybe I had to mention this earlier. I’m using the NewsPress template.
I hope you can figure this out. Thanks again.
Wow, Gert: I don’t usually use galleries, but I tested it. On my WP 2.8.5 website the WP gallery works fine. I tested with the category showing on the Front Page but hidden from most everything else.
I don’t use NewsPress for a template. I did notice that someone on the Cleaner Gallery site complained about exluded not working, and that’s what we use getting posts, but the developer said it was working. So there might be some other combination of things triggering this, even without the Cleaner plugin.
The old version of this plugin was very complex, changing join and where clauses, etc., but the new one is very simple. For posts it simply adds categories to the ‘exclude’ list before running the get_posts query. And it should work unless something else interferes with that list.
If you deactivate CatVis does the gallery work again?
Does anyone else have an idea?
Hello Rich,
I still do not know what the problem is. The problem is not the theme because it also did not work with e.g. the Kubrik theme. The problem also isn’t another plugin, because I tested the plugin on its own without another plugin activated.
Although I am curious what the answer to the problem is, I decided to use the NextGen Gallery plugin. This works great. So the quest to the answer on my behalf is over, because I’m not that into The ‘PHP’ Code.
Still I would like to thank you for the support provided. It is nice to know that when you come home an answer is there waiting for you! Thanks a lot, good luck and enjoy life!
And if anybody would like me to try another thing or two to find out what the initial problem was, please do tell me.
Cheers Gert.
If you deactivate CatVis does the gallery work again? Yes, it does.
Forgot that one.
If you are curious, I can e-mail you the code?
Gert, I’m delighted you found a workaround. Strange that the gallery worked for me when I tried it. And that turning off CatVis made it work for you. Puzzling.
Thanks for your efforts! And I’m glad it’s working for you now.
Thank you so much for this really easy tool! I was looking for ages for something like this, I needed to hide a category on a dance site I am creating, check it out. I was editing the index.php page and the functions.php pages still nothing was working. How can I donate?? Thanks Tom
[...] my categories on the sidebar on my terms. The best I had found was the well written and executed Category Visibility-RH but I wanted to choose from all my categories and still limit the number [...]
very practical plug in, it helped me,
Thanks
:)
[...] © Category Visibility Kategorilerinizi özelleştirebilmenize olanak verir, kategorideki yazıları ister ana sayfa da [...]
[...] 104 © Category Visibility [...]
Just testing the plugin with WP 2.9.1 and so far it’s working. I think that if a PARENT category is checked to not be showed, it should be automatically applied to it’s child categories without checking single child categories. Thanks.
[...] post is a test of the Category Visibility plugin created by Rich [...]