Hide pages from menu (source code)
-
I have no menu at all (WordPress -> Appearance -> Menus shows no menu, also in the Customizer is no menu).
One page especially should be hidden and only be accessed via directlink.
To not get indexed by search engines I disabled that option for this page in the “Yoast Seo” plugin.
This also excludes the page automatically from my sitemap.
All of this is working and the page isn’t indexed by google.The problem is, when I search for the page name in quotes “company name page name” (for example) I can find the page, but not because google finds the page itself, but because on my homepage (mydomain.com) a link in the menu (that menu that doesn’t exist) includes a link to that page.
So the menu and the page is present in html, even though I have no menu and no menu visible.The html looks like this:
<pre><code><div class="header-navigation-wrapper"> <nav class="primary-menu-wrapper" aria-label="Horizontal" role="navigation"> <ul class="primary-menu reset-list-style"> <li class="page_item page-item-1349"><a href="#">Placeholder</a></li> <li class="page_item page-item-1346"><a href="#">Placeholder</a></li> <li class="page_item page-item-130 current_page_item current-menu-item"><a href="#" aria-current="page">Placeholder </a></li> <li class="page_item page-item-585 page_item_has_children menu-item-has-children"><a href="#">Placeholder</a><span class="icon"></span> <ul class='children'> <li class="page_item page-item-315"><a href="#">Placeholder</a></li> <li class="page_item page-item-317"><a href="#">Placeholder</a></li> <li class="page_item page-item-319"><a href="#">Placeholder</a></li> <li class="page_item page-item-669"><a href="#">Placeholder</a></li> <li class="page_item page-item-671"><a href="#">Placeholder Socken</a></li> <li class="page_item page-item-673"><a href="#">Placeholder</a></li> <li class="page_item page-item-321"><a href="#">Placeholder</a></li> <li class="page_item page-item-675 page_item_has_children menu-item-has-children"><a href="#">Placeholder</a><span class="icon"></span> <ul class='children'> <li class="page_item page-item-721"><a href="#">Placeholder</a></li> <li class="page_item page-item-718"><a href="#">Placeholder</a></li> </ul> </li> <li class="page_item page-item-325"><a href="#">Placeholder</a></li> </ul> </li> <li class="page_item page-item-271"><a href="#">Placeholder</a></li> <li class="page_item page-item-1151"><a href="#">Placeholder</a></li> <li class="page_item page-item-583"><a href="#">Placeholder</a></li> <li class="page_item page-item-269"><a href=#/">Placeholder</a></li> <li class="page_item page-item-1165 page_item_has_children menu-item-has-children"><a href="#">Placeholder</a><span class="icon"></span> <ul class='children'> <li class="page_item page-item-1169"><a href="#">Placeholder</a></li> <li class="page_item page-item-1177"><a href="#">Placeholder</a></li> <li class="page_item page-item-1173"><a href="#">Placeholder</a></li> </ul> </li> <li class="page_item page-item-1136"><a href="#">Placeholder</a></li> </ul> </nav><!-- .primary-menu-wrapper --> </div><!-- .header-navigation-wrapper -->
Of course I don’t want to share the page link because then I would expose my page even more.
Any ideas where this menu comes from even though I disabled it and have no menu? How do I get rid of it?
Thank you very much!
- The topic ‘Hide pages from menu (source code)’ is closed to new replies.