{"id":2020,"date":"2009-12-10T09:00:38","date_gmt":"2009-12-10T08:00:38","guid":{"rendered":"http:\/\/www.bitvolution.com\/?p=581"},"modified":"2009-12-10T09:00:38","modified_gmt":"2009-12-10T08:00:38","slug":"how-to-have-a-hidden-wordpress-page","status":"publish","type":"post","link":"https:\/\/www.tomfotherby.com\/blog\/index.php\/2009\/12\/how-to-have-a-hidden-wordpress-page\/","title":{"rendered":"How to have a hidden wordpress page"},"content":{"rendered":"<p><img data-recalc-dims=\"1\" loading=\"lazy\" decoding=\"async\" src=\"https:\/\/i0.wp.com\/www.tomfotherby.com\/blog\/wp-content\/uploads\/2009\/12\/WordpressLogo_blue-m.png?resize=100%2C100&#038;ssl=1\" alt=\"Wordpress Logo\" width=\"100\" height=\"100\" class=\"alignleft size-full wp-image-611\" \/>A typical use case for a hidden page might be so you can store your website licensing agreement or image attribution links without having it explicitly in the main navigation links &#8211; most folk link to their licensing agreement in the footer.<\/p>\n<p>If you want to have a page on your self-hosted WordPress website that is accessible via a URL but not directly linked or advertised on the site, you have several options:<\/p>\n<ol>\n<li>Use a plugin such as &#8220;<a href=\"http:\/\/wordpress.org\/extend\/plugins\/exclude-pages\/\">Exclude Pages<\/a>&#8220;.<\/li>\n<li>If your pages are displayed via a sidebar widget, you can go to the widget settings page in the WordPress admin section and use the &#8220;exclude&#8221; field to hide a page ID.<\/li>\n<li>Save the page as a &#8220;draft&#8221; but never publish it. Even though it&#8217;s not live, you can still access the page if you type the direct URL to the page. e.g. http:\/\/yourblogurl\/?page_id=69.<\/li>\n<li>Modify the <em>wp_list_pages<\/em> function in your current theme:\n<ul>\n<li>If you know you don&#8217;t use any sub-pages on your site, you can hide any page you want by making it a sub-page of the homepage and then display your menu using: <code>&lt;?php wp_list_pages('depth=1'); ?&gt;<\/code><\/li>\n<li>To exclude a page with id 69, use: <code>&lt;?php wp_list_pages('exclude=69' ); ?&gt;<\/code> If you do this you can automatically hide additional pages by making them a sub-page of the hidden page.<\/li>\n<\/ul>\n<\/li>\n<li>Create a new file in the theme directory. It will be accessible via http:\/\/yourblogurl\/wp-content\/themes\/yourthemename\/yoursecretpage.php. If you want to use regular wordpress functions in the secret page, include the following on line 1: <code>&lt;?php require_once(dirname(__FILE__) . '\/..\/..\/..\/wp-blog-header.php'); ?&gt;<\/code><\/li>\n<\/ol>\n<p><strong>Note: <\/strong>WordPress does have a &#8220;Private&#8221; checkbox that you can tick in the <em>visibility<\/em> section of the <em>publish<\/em> options. However, private pages will not be accessible via any URL.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>A typical use case for a hidden page might be so you can store your website licensing agreement or image attribution links without having it explicitly in the main navigation links &#8211; most folk link to their licensing agreement in the footer. If you want to have a page on your self-hosted WordPress website that [&hellip;]<\/p>\n","protected":false},"author":52,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[79],"tags":[87],"class_list":["post-2020","post","type-post","status-publish","format-standard","hentry","category-technical","tag-wordpress"],"jetpack_featured_media_url":"","jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2020","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/users\/52"}],"replies":[{"embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/comments?post=2020"}],"version-history":[{"count":0,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/posts\/2020\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/media?parent=2020"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/categories?post=2020"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.tomfotherby.com\/blog\/index.php\/wp-json\/wp\/v2\/tags?post=2020"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}