gunI did some tweaking to my site over the weekend, and in the process, I almost shot myself in the foot, and learned a couple of things about managing how pages appear in a site’s main navigation that I thought you might be interested in. I wanted to add some new menu items and rearrange the content a bit, so that all my work was under a Portfolio page instead of being individual top level menu items. I got all the changes made and was happy with the way things were set up until a reader pointed out to me this morning that the link to my I Follow page was no longer working. Duh…. changing the page structure also goofed up the URL of the page on this site that is most linked to by other blogs. So, I moved the appropriate page back up to the top level, but then I had a problem: I didn’t want it to be an item in my main navigation. I looked around for a solution like a page redirect, or a plugin that would allow me to choose which pages would display in the main nav, and ended up finding a page in the WordPress Codex which details how to customize your menu by adding parameters into the wp_list_pages tag.

I also learned about the Page Order feature that I had never paid much attention to. In page editing mode, you can assign each page a number to sort by so you can arrange your pages in any order you like in your menu. Then you can add the appropriate bit of code from the above referenced site into the wp_list_pages tag to display them in the order you’ve specified in your site menu.

I also added an About page with a bit more info than just the blurb that used to be in the sidebar, and added a Site Map page that I still need to beef up a bit that makes use of the Clean Archives plugin. I’ve implemented this plugin on a couple of sites now and have found it very easy to use and a great improvement.

Any comments on the changes I’ve made? They’re not huge changes, but hopefully it will make it easier to manage the content as this site grows.



You might also like:
  • A CSS flyout menu that works in Firefox AND IE
  • 3 great free web site design tools
  • How to dress up your 404 page
  • Did you like this post? How about subscribing in a reader or via e-mail.


    10 Responses to “How to hide pages and rearrange your menu in WordPress”

    1. 1 MyAvatars 0.2 Bull3t

      Loving the changes, makes it easier to navigate and to know more about you. Hehe, I never knew that you could exclude pages from the navigation either, nice find. Thanks for the link too.

      If you want an XML sitemap generated automatically, I would suggest: Google (XML) Sitemaps if you haven’t already checked that out.

    2. 2 MyAvatars 0.2 David Airey :: Graphic Design Edinburgh ::

      Randa, this is fantastic!

      I’ll bookmark it and read it in the morning as I plan on making similar changes.

      Thanks for letting us know.

    3. 3 MyAvatars 0.2 SavingDiva

      Your page is super helpful for a newbie like me! Thanks for the great posts!

    4. 4 MyAvatars 0.2 Randa

      Thanks for the encouraging comments!

    5. 5 MyAvatars 0.2 Nueva York

      I have WP in my blog and this tutorial is very helpful. Thanks!

    6. 6 MyAvatars 0.2 Simon

      I was looking to do the same thing recently, but for a client who wouldn’t be able to edit the templates. In the end I developed a plugin which you can download here: exclude pages from Wordpress navigation. It may not be useful to you, four months down the road though!

    7. 7 MyAvatars 0.2 Stephen

      Simon, Thank you for 1) writing that plugin. And 2) commenting here. Your plugin is exactly what I’ve been looking for.

      Though the link you gave is now dead, but here are the updated links to anyone else who may be looking for it…

      Simon’s plugin page
      Simon’s Exclude Pages plugin page

    8. 8 MyAvatars 0.2 Simon

      Thanks for pointing that out Stephen, I’ve added a redirection in which means that link should now work. (The links you added also work fine.)

    1. 1 Graphic Design Blog » Wordpress as a CMS - Content Management System
    2. 2 Buffer Dump 27DEC07 « Feet up, eyes closed, head back