• Hi,

    I would like to know how I hide a page but allow visitors to see it if I give them the URL?

    Does that makes sense?

    I want to create a page but visitors will only be able to see it once I give them the url.

    thanks

Viewing 5 replies - 1 through 5 (of 5 total)
  • Well usually all pages are display on a site using the wp_list_pages function, which is either in the sidebar or the heading.

    If your theme is not using a widget then you can find where in your template files the wp_list_pages functions is used and then change it to this, replacing the number 1 with the ID of the page you want to exclude:

    <?php wp_list_pages('exclude=1'); ?>

    This means that there will then not be a link to the page on any of your websites pages however the page will still there at its own permalink URL.

    If you use a widget to display you pages I think the widget has an exclusion facility built in.

    Hi,

    You need to edit header.php file of your theme and search for the code:

    <?php wp_list_pages('sort_column=menu_order&depth=1&title_li=');?>

    and replace with:

    <?php wp_list_pages('depth=1&sort_column=menu_order&exclude=55,422&title_li=' . __('') . '' ); ?>

    I have provided the page ID 55 and 422 which needs to be excluded from the list. You can set this ID as per your requirement.

    Thanks,

    Shane G.

    I’m sure there used to be an easier way to do this. I have only recently upgraded to WP 2.8 from 2.3, and there used to be a screen where you could just list the page numbers, separated by commas, that you wanted excluded. You didn’t have to delve into the code. Has this now changed?

    Hi,

    You can also exclude the page with the help of this plugin:

    https://www.ads-software.com/extend/plugins/exclude-pages/

    Thanks,

    Shane G.

    Ignore my last post – I have just found it! I have a widget for the pages.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘How do I hide a page?’ is closed to new replies.