How to remove the link to parent pages when using wp_list_pages in WordPress navigation is today tips that we want to share. This code original by Digital Forum user and shared by WP Garage. This tricks using pure jQuery, how to run jQuery without conflict you can revert to my Fix jQuery WordPress Conflict.
Let’s get started, open your header.php and add this code
<script type="text/javascript"> jQuery(function($) { $("li.page-item-283").children("a").attr('href', "javascript:void(0)"); }); </script>
On the code above, only page 283 that link will be remove, to remove all top parent page using this code
<script type="text/javascript">
jQuery(function($) {
$("li.page_item").children("a").attr('href', "javascript:void(0)"); });
</script>
If you have another solution, please let’s me know, our hope How to remove the link to parent pages when using wp_list_pages in WordPress navigation become more useful.
Photo from Egotastic




nice tricks i really in search of it.
I can’t get this to work! Please help! I copy and pasted it in the header change the page number but it doesn’t do anything. maybe because i was using wp_menu rather than wp_list_pages?
Pingback: Disable WordPress Parent Navigation items from showing page | Css-Web-Design