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

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.
  • 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.


Share and Enjoy:

  • Print
  • email
  • Twitter
  • Facebook
  • LinkedIn
  • Digg
  • del.icio.us
  • Google Bookmarks

454 Responses to “RYO ‘Category Visibility’ WordPress Plugin”

  • James Briggs:

    I hope you continue to keep this plugin up-to-date. There aren’t any other working plug-ins like this available.

  • ace:

    i was looking for something like this i will install and send you my feedback

    thank you

  • jd:

    Great that you are updating this, because the ipeat one is full of bugs. Just tested the beta, and it works when the blog is on the frontpage, but not when the blog is assigned to a page (settings – reading – “Front page displays A static page” and a posts page is chosen). Would be great if this worked, because this is how I setup my blog.

  • You have some great plugins on your post. Your insight and expertise would be a welcome addition to our new community, i hope you will consider joining, and thanks for sharing!

  • Great plugin – just what I’ve been looking for.

  • Just replaced Category Visibility-iPeat Rev to this one. iPead made a mess in WP_Query – WP_Query+’cat’ = no results

  • Rich:

    barat… This version takes an entirely different approach to make it all happen.

    So, the iPeat revision, as with my 2.0 version, are really out of date.

    And, frankly, this approach is so much better and should have been the approach we took then. This is simpler and fits right in with defined WordPress template tags, where the old approach relied on data query modifications.

  • Guys, this is superb – you deserve all the praise in the world for this. HIGHLY recommended, and works a tread. Well simple to use, too.

    Thank you!!

  • Eef:

    great plugin -just what I was looking for. thanks alot!

  • Jules:

    Thank you a lot for this. How come this is not listed in the WP Plugin Library? Because it’s by far the most comfortable plugin I’ve found for category exclusion so far! Works like a charm in WP 2.9.2!

  • Thanks a lot – great job! Just installed it on a project-website in WP 2.92, combined with a press75 Theme, has amazing results. Thank you!!!

  • Shai:

    Was looking for this for ages. tried to edit files by myself but didn’t work. this one worked liked magic!@

    Thanks a lot!!

  • Thanks a lot great job

    i try it on my blog version 2.9.1 it’s work fine

    thanks

  • Omer:

    Awesome plugin, works like magic! Thanks a million!

  • wow, nice plugin

    very powerfull….run that plugin for each category

  • jaynec:

    Great plugin! It is exactly what I kept looking for! Thank you so much! It works fine with WP 2.9.2.

  • Thanks for this plugin! I was looking for something to better link my categories to posts and this did the job

  • Ricky Foyle:

    Works like a charm! Exactly what I was looking for. Thanks for sharing :)

  • [...] RYO Category Visibility : [...]

  • [...] Download the plugin from here [...]

  • Excellent, thank you so much for making this! :)

  • Thank you! This is an excellent plugin and works with WP 2.9.2 Works with static homepage setup as well.

  • hi there! i’ve been using your plugin for a while, and i love it. i would also love it if you could add a feature that allows posts categorized with two categories (one hidden from the front page and one showing on the front page) to be shown on the front page if one is a “hidden” category. i know you said this isn’t possible in your plugin readme but i would LOVE this feature if you could implement it. what do you think? thanks! jessica

  • Dave:

    Hey, thanks, I’ve been looking for this too. I installed your beta on the Atahulpa theme with WordPress 3.0. So far seems to work fine. In my case, I just wanted to be able to hide some of my cell phone pics. As a pro photographer I’m not crazy about having them seen in front of my good work, but I want to take advantage of geo-tagging and support my local community events, charities, etc!

  • Great plug in. I have added it as a post to my blog.

  • Rich:

    Thanks, Matt, but it’s better to link to the plugin page instead of the file because that way folks can see more about how it works.

  • [...] 対応) Advanced Category Excluderがあるが正常動作しないのでRYO Category VisibilityというPlugInで実現できる。 [...]

  • excellent plugin thts wht i was searching from long time and finally got working good

  • victor:

    Great plugin,

    i have just installed wp 3.0 and have anyone had compability issue ? thoses thos one also hide pages created in WP, have been using wp hide-post plugin for it but would be much easier to have it all in one place.

  • Rich:

    We use it with 3.0.

  • Please could someone help me. I really want to get this plugin working for my site. When I activate the plugin and then loads my website I get the below error.

    Fatal error: Call to undefined function get_currentuserinfo() in /home/nomadsn1/public_html/wp-content/plugins/ryo_catvis/ryo_catvis.php on line 88

    Anyone got any advice?

  • Rich:

    Try beta 6. Hopefully it will correct your problem!

    It could, however, cause problems with other plugins as it forces load of pluggable.php. So I’ll need feedback from others.

    The catch here is that pluggable is normally loaded after all plugins are loaded. We make the call to get_currentuserinfo() in a function that I would expect to be called after plugins are loaded. So it ought to be okay, but maybe not!

    It’s only an issue, I think, if you’re specifying a “level number” for access. And that may have to get changed because the WordPress folks are talking about taking that deprecated method completely out of WordPress in favor of the more flexible Roles and Capabilities. Which haven’t been embraced as much as they’d probably like.

  • Thanks Where do I find the download for beta 6? I’ve downloaded from the link above but when I install it and check the plugin section it says 3.0beta5 and still doesn’t work.

    Thanks

    Chris

  • Rich:

    Chris,

    I checked the download. It is beta 6. If yours says 3.0beta5 then you had a problem with the download or the upload to your website.

  • Miki:

    Thank you very much for this plugin. It’s incredibly useful and does exactly what I want it to do.

    I’m having one slight problem, though. I can’t seem to get the feed to display only a single category. (I hope that makes sense.) No matter what category number I try to use, I only see the main feed. Any idea how to get around this?

  • Rich:

    Miki, In the panel, under Feed check the one category you want and uncheck the rest.

    (And be sure the “Check to Exclude” box is unchecked.)

    That’s all! I tested one of my sites again this morning with the current download and it works fine.

  • Drew:

    I was hoping I could use this to restrict access by category to only those with an account. The user level option does not seem to let me do that since subscriber is 0. Am I missing something?

  • Rich:

    Drew, that’s one of the problems with User Level, and why WordPress has deprecated User Levels (by number). Maybe sometime in the future we can do it by Capability and use the Roles and Capabilities feature.

    The challenge with that is that WP has relied on plugins to manage Roles and Capabilities, and none have been kept in service. The old Role Manager plugin was terrific but support was dropped several years ago and it’s not fully functional with today’s WordPress. I thought I had found a good replacement with CapsMan but he’s not keeping it up any longer. At some point I’ll look into that. For now, Subscribers will be left out as they are level 0.

  • Drew:

    Thanks Rich. I am looking at User Access Manager and it seems to give me what I want.

  • Rich:

    Gary Wardell wrote “It works great for moving posts off the front page and out of the monthly archives. But it still counts those posts in the archive month list on the front page.”

    Check Beta 7… I think we’ve fixed that problem.

    Rich

  • Rich:

    Drew,

    I hope that works out for you. One of the challenges with plugins that restrict access to certain member types is that they

    (a) add additional tables to the database. Sometimes this is necessary, sometimes not.

    (b) add additional database reads. A bit of this is almost always necessary but some are really heavy hitters. I use WishList Member for this purpose, but their latest version hits the database pretty hard.

    It’s hard to optimize everything. And some do it better than others. For the most part, CatVis does what it does by reading only one entry stored in the WP options table. And no additional database queries.

  • [...] einwandfrei funktionierendes Plugin hierfür ist das RYO ‘Category Visibility’ WordPress Plugin. Es lässt sich nicht nur für Feeds, sondern auch für alle anderen Bereiche von [...]

  • your RYO ‘Category Visibility’ WordPress Plug-in doesn’t work!!!

    it works when you see that categories are hide but your prg hides Blog Posts also!

    when uninstall RYO ‘Category Visibility’ WordPress Plug-in then I can see my blog posts but after installing RYO ‘Category Visibility’ WordPress Plug-in then I lose them! your program and all other category hiding plug ins doe same prb!!! and that ruins all the site!

    can you fix it ASAP! and let me know.

    thanks

  • Rich:

    Errol,

    I think you don’t understand the purpose of the plugin. It’s supposed to keep posts off the selected portions of a site if they are in the designated categories.

  • Great plugin – thanks!

    I used it to hide all posts categorised as “Old-Site” from appearing on the home page, and then used a Page-links-to plugin to link an “Old Site” page directly to that category listing.

    This way I get to put up a bunch of old PHP-Nuke posts from before I ran WordPress without them clogging up the feed & front page =D

  • Its an AWESOME plugin.

    It removes all the categories from my home page – which is what I wanted.

    But my issue is that a text appears instead saying “No Categories” – in the middle of the darn navigation bar on my home page. Its as if it NEEDS a category to be present. Thats not all – it will assign the category PAGE RANK 1, so the navi bar basically has the stupid category tab before the HOME tab!

    Whats going on, please help :(

  • GREAT PLUGIN! Thanks a lot!

  • Rich:

    “No Categories” is a feature of the nav bar/widget. Has nothing to do with RYO Category Visibility. Use a different widget, or remove the widget, and it should go away.

Leave a Reply

Powered by WishList Member - Membership Software