So "incognito" or "private mode" means "not logged in"? Interesting.
Have you tried the core DokuWiki configuration options? Admin -> Configuration:-
sneaky_index
By default, DokuWiki will show all namespaces in the sitemap. Enabling this option will hide those where the user doesn't have read permissions. This might result in hiding of accessable subnamespaces which may make the index unusable with certain ACL setups.
hidepages
Hide pages matching this regular expression from search, the sitemap and other automatic indexes
disableactions
Disable DokuWiki actions
To prevent "showing" links to Recent Changes and Index (site map) you can modify the template instead of the core DokuWiki.
e.g. with the default DokuWiki template:-
Edit dokuwiki/lib/tpl/dokuwiki/tpl_header.php and change:
<?php
tpl_toolsevent('sitetools', array(
tpl_action('recent', true, 'li', true),
tpl_action('media', true, 'li', true),
tpl_action('index', true, 'li', true)
));
?>
To:
<?php if ($INFO['isadmin']): ?>
<?php
tpl_toolsevent('sitetools', array(
tpl_action('recent', true, 'li', true),
tpl_action('media', true, 'li', true),
tpl_action('index', true, 'li', true)
));
?>
<?php endif ?>