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.

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

RYO Category Visibility Options Page

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

  1. Simply download and unzip it.
  2. Put it in your plugins directory.
  3. Activate it.
  4. 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. (Or, probably in any list based widget.)
  • 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. (Yes, I know this is deprecated, but I’ve left it in for folks who want it.)

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 for WP 2.8+: Ver. 3.0.1.

Legacy version, WP 2.0.x: Ver. 1.0.0e. This plugin version only works in WordPress 2.0.

587 Responses to RYO ‘Category Visibility’ WordPress Plugin

  • Rich says:

    That’s a good question, and the answer is that this uses an “exclusion” process. It passes to WordPress a list of categories to exclude from any particular list, those that are “unchecked.”

    So… I believe the way WordPress is handling this at this time is that if any of a post’s categories are unchecked the post will not appear.

    As to the sidebar widgets, in most themes at least this should behave according to the “Lists” designation in the plugin.

    The best advice I have is to try it and see how it works for you. It’s a low overhead plugin.

  • chickarama says:

    Thanks for your response. I’ll give it a try in a few weeks, the site is too busy right now to test things out.

  • Pingback: 用WP打造一个真正的个人网上空间 | Tiger's Blog

  • S. says:

    Thank you very much for your plugin ! I really like it but when in single post view, in any category, if the previous or next post is in a hidden category it will still show. Is there a way around this ? Thank you !

  • Rich says:

    S, The plugin does nothing for navigation on single posts. Might be something to look into. As it is it only attempts to manage what’s listed in the Front page, in Lists of Categories in the sidebar, in Search results, in Feeds, and in Archives.

    You do suggest an interesting concern. (I don’t display navigation between posts on my single pages.) Perhaps a future enhancement.

  • Rich says:

    S., I looked a little deeper and until the WP folks add a hook in get_adjacent_post() where I can add to excluded categories we can’t affect the navigation on single posts. Maybe that will change someday.

  • S. says:

    Ok Rich thank you very much for having a look at it ! I might remove navigation links on single posts or maybe use pages for private posts, but i’m concern about search on pages… and I still want some pages to be found, ah ! ^^

  • Dan says:

    Wow… Just wow… This CATVIS plugin is AMAZING. Thanks RYO, great great great!!!

  • Shalu Sharma says:

    Does this plugin exclude categories from the sidebar as well?

  • Pingback: Jess Coburn's Personal Blog » Pimpin’ My Wordpress Part 5 – Hiding Categories in Wordpress

  • Pingback: Useful WordPress Plugins To Optimize Your Blog | ReSell Rights Applied

  • pixelsophie says:

    Thanks for great plugin!

  • rain3r says:

    @Shalu Sharma

    Yes, it does.

    This is an awesome plugin!

    But why it is not listed under http://wordpress.org/extend/plugins/ ?

    It definitely should!

    Thanks. :)

  • Pingback: Best WordPress category exclude plugins | How to Create a Website? Free webdesign and website development tutorials for beginner to advanced. Unique Webdesign, Blog Development and Maintenance

  • shahi says:

    awesome plugin

  • Peter says:

    Hello Rich,

    the Plugin doesn’t do what I want :-( I want to hide certain posts (the category “pw-protected”) only from the main window. At all the other Lists and – very important – trough the search the articles should be found. But they don’t!

    I unchecked only one Field, “Front”, for this category, but from now on the search doesn’t find the pw-protected category at all. In the sidemenu the articles are away, too.

    Do I make a mistake?

    WP 3.4.2

    A little help would be very nice.

  • Pingback: 宅不 » 煎蛋所用的模板和插件

  • Very, very useful plugin.

    I just noticed that when you have unchecked “Front” for a category, the handy post list in the WordPress app for Android will no longer show the post. I think this part of the app is using xmlrpc, so that makes sense. You still can edit posts in hidden categories using the full Dashboard part of the app.

  • Clare says:

    Just want to say a huge thank you for this plug in. I had over 3000 categories and had to hide a lot from the sidebar and this worked wonders :-)

  • Thank you. I really like this add-on.

  • vancho says:

    Thanks you! This plugin just slove my problem :)

  • Pingback: kuaza haber teması lite kategori kısıtlama | Web Günlüğü

  • This breaks Search. Strange problems where search terms are not found even in post titles or post text. The actual post containing search term does not belong to any hidden category. I would advise doing a thorough testing of your search after installing this.

  • Pingback: WordPress Plugins for Blog Layout, Formating, and CSS Designs « Lorelle on WordPress

  • Jenna says:

    Love this plugin! Wanted to send a Thank you donation, but the plugin doesn’t have a Paypal Donate link :\

    This plugin is so so appreciated,

    THANK YOU!

  • Sofie says:

    So this is still working? Wordpress says it hasn’t been updated in years:/

  • Rich says:

    Should be working still. When I wrote “The result is faster, leaner, and, I hope, more likely to work with newer versions of WP. The same, familiar interface. Far more efficient.” … I meant it! (Although one user reported search problems in May, 2013.)

    Try it Sofie and update us on your results! (And WordPress doesn’t know when I update it.)

  • Marco says:

    Very, very, very, very useful plugin. It ishould be listed under http://wordpress.org/extend/plugins/ THANK YOU

  • Jenna says:

    SO sad! This plugin was great and unfortunately it seems to have stopped working for our site :\. Not sure if it no longer working is related to the recent upgrade but maybe timing wise it seems so? Also not sure if it’s specific to our site. Basically, it just no longer responds. If we select a checkbox it checks, but then once we hit save, it unchecks. It saved everything we “checked” up until recently, it just wont allow anything new to be checked. Is it possible there is a limit to how many categories it will control? We tried removing and re-installing, but it doesn’t help. We loved this plugin :)

  • Rich says:

    Yes, it’s possible that too many categories could affect this plugin… sort of. Newer php versions have a limit set as to how many fields can be passed in a form. The plugin has about 7 fields for each category plus a few administrative fields.

    If your php limits you to 1000 fields your category limit would run about 142.

    There could also be server memory issues.

  • Kostadin says:

    Hi Rich,

    Your plugin works very well :) Thank you for it!

    However there is one small bug that I hope to resolve with your help. I use the plugin to hide from the general stream the posts that are in my slider at the top of the page so articles don’t double in the slider and in the general stream. Problem is, now when I click “Load More” button at the bottom of the page(on the Home page I show only the seven latest articles), when WordPress loads 7 more articles, some of them are doubling with the first 7, that were originally show.

    Any help will be welcome :)

    Thank you, Kostadin

  • Rich says:

    Well, you’re dealing with a conflict between plugins.

    CatVis simply tells WordPress to exclude certain categories from the home page. WordPress handles that fine, but your slider may not identify properly.

    When I updated CatVis to work with WordPress 2.8 and later the new logic was greatly simplified over the old version. Now it’s a very simple instruction to WordPress, not an interference with the database requests.

  • Kostadin says:

    I am using the theme Nexus. I think the conflict comes from there, but am unable to understand the main loop it uses to load the articles. Any ideas how should I modify it? Will it be of any help if I post it here?

  • Rich says:

    No idea. Posting it here wouldn’t help. If it’s the Nexus slider, you might try some other slider plugins to see if they behave differently. Every one is going to handle their internal loop differently.

  • Kostadin says:

    Thank you anyway Rich!

  • Janine says:

    Thank you for this. I’d been looking for quite some time on how to make just one category show up on the front page.

    Question – how do you limit the number of posts that are shown? So that only the most recent 2-3 are showing?

  • Ricky.NZ says:

    Hello there, thanks for the plugin, works as a charm! Thanks again.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>

Member Center
UserID:

Password: