Have you ever created a page in WordPress and didn’t want it to show up in the sidebar menu with the title you saved it under? Well, a client recently wanted his home page titled “Welcome to Our Site” for when the visitor entered his domain, but wanted to show this page as his “Home” page in both the header and sidebar of his WordPress template.

After several failed attempts to search Google, and unanswered posts to queries in WordPress forums for a resolve for the sidebar, and I attempted to make the change myself. Voila… it worked!

Earlier on, I had discovered how to solve this issue with the header.php, but could NOT find help with changes needed in the sidebar. So, using what I was given to resolve renaming the page title for the header.php, which was as follows:

<li><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>
<?php wp_list_pages(‘sort_column=menu_order&depth=1&title_li=&exclude= 113′); ?>

Be sure YOU change the page numbers for exclude= 113′); ?> that YOU want excluded in YOUR WordPress template.

Here’s how you can discover the ID of your page. Sign in to your WordPress Admin panel and click on Pages. Locate the page you wish to hide in the navigation, and open in Edit mode… note what I have circled in red, in the screen print below. [click on image below to see a closer view. Use your browsers back button to return here.]

In this case, your number would be 145.

Anyway, after several attempts I decided to try using the following code:

<li><a href=”<?php bloginfo(‘url’); ?>”>Home</a></li>

<?php wp_list_pages(‘title_li=&depth=-1=&exclude= 13′); ?>

When I added this, the sidebar immediately gave 2 lists of pages to navigate… with “Welcome to Our Site” missing on the second, but “Home” appeared.

Then I located the following code in the sidebar.php:

<?php

foreach ($recentposts as $post) {

if ($post->post_title == ”)

$post->post_title = sprintf(__(‘Post #%s’), $post->ID);

echo “<li><a href=’”.get_permalink($post->ID).”‘>”;

the_title();

echo ‘</a></li>’;

}

?>

…and removed it all together. Voila! The sidebar appeared as my client wanted it to!

Finding help doing a Google search these days can be very frustrating, to say the least.  However, knowing how frustrated I was in trying to get help with this…. I will post my resolve here, in hope that Google will offer it to you in YOUR next search for how to hide a page from sidebar navigation in WordPress.