I recently got an e-mail from a reader wanting to know how to hide their sub-categories in WordPress. If you use WordPress 2.1 or newer, this is actually really easy to do.

All you need to do is open your stylesheet and add the following anywhere:

.children {
display:none;
}

You can also style the children accordingly this way if you’d like!

Digg This! | Stumble it! | Add to Del.icio.us | | Print This! |

There Are 8 Responses So Far. »

  1. 1 Garry Conn
    Monday, February 25th, 2008 at 6:25 pm

    Kyle,

    That is a pretty common and neat little CSS trick. Unfortunately doing something like that could cost you a “good standing order” with Google and other search engines.

    You might want to consider explaining this in your post so that you’re not misleading people who would rather not endure a ranking penalty.

    Source: Google Webmaster Guidelines - Hidden Text and Links.

    Not busting your chops, I just think that you might not have considered this as being something harmful for your readers.

    Best Regards,
    Garry Conn

  2. 2 Kyle Eslick
    Wednesday, February 27th, 2008 at 7:14 am

    @ Garry - I appreciate your concern; however, it is important to note that sub-categories are internal links, rather than linking out to another website.

    In addition to usually not being indexed due to the Robots.txt settings on most WordPress blogs (this is done by default for All-in-One SEO Pack users), passing internal link juice behaves differently than passing link juice to other websites. As a result, it does not seem to me that this would be a violation of Google’s guidelines. All you are really doing is promoting your internal pages, which is something standard that webmasters do to emphasize certain posts/pages.

    From what I can tell in reading through their guidelines, Google’s concern is with people hiding external links, not internal links.

    Another option for a WordPress user is to, of course, not create any “children.” Just treat all categories as “adults.”

  3. 3 Garry Conn
    Wednesday, February 27th, 2008 at 10:57 am

    Kyle said, “I appreciate your concern; however, it is important to note that sub-categories are internal links, rather than linking out to another website.”

    Kyle, come on man… do you really think that I don’t know the difference between an external link and an internal link?

    Kye said, “passing internal link juice behaves differently than passing link juice to other websites. As a result, it does not seem to me that this would be a violation of Google’s guidelines.”

    Ok, let me get this straight, you believe that Google has two or more different kinds of PageRank? Specifically, there is an independent PageRank system just for internal links alone?

    I am not buying that. I see no official documentation on Google regarding that, nor do I see anywhere written where it says, “Don’t hide external text links, but please by all means, have a field day and hide all your internal links! The staff at Google work hard towards creating TWO PageRank Systems for webmasters and publishers who want to exploit everything we say not to do but do so internally.”

    I wasn’t going to make a stink about this, but when you shoot my comment down, which I must mention again, I am just trying to help, it some what disappoints me.

    Your post is misleading. Anyone that uses CSS to style your links (internal or external) to cause them to be hidden run the risk of paying a ranking price in the major search engines.

    Wouldn’t it be a better solution to use the WordPress supported Include or Exclude Category Template Tag.

    Like I said in my first comment. I am not busting your chops, I just feel that your post is misleading. I am not one to just rant and rave and leave. If you look at the above reference, you’ll see that the solution I am presenting does what you want and does what I want combined. It has the ability to hide any category or sub category the publisher wants hidden and it doesn’t write the link code on the pages.

  4. 4 David Cooley
    Wednesday, February 27th, 2008 at 11:22 am

    Not sure why PageRank was mentioned in these comments, PageRank has nothing to do with it.

    “If your site is perceived to contain hidden text and links that are deceptive in intent, your site may be removed from the Google index”

    I have seen it done, if you hide ANYTHING, text or links, your site can (and probably will) be dropped from the Index.

  5. 5 Garry Conn
    Wednesday, February 27th, 2008 at 12:06 pm

    David Said, “Not sure why PageRank was mentioned in these comments, PageRank has nothing to do with it.”

    Yeah no doubt… I didn’t mean to expand on that but I felt like that part of the comment needed to be addressed as well.

    David is totally right. PageRank or any ranking systems used by the major search engines are totally not the issue at hand. This is a issue that can cost you a free gift of having your website listed in very popular search engines.



Leave A Comment