Jetpack 101

How to Hide a Page in WordPress: 8 Easy Methods That Work

Woman working on her laptop in a communal workspace.

Most WordPress sites have more than just a homepage — pages like About, Contact, and Services are pretty standard. These are essential for helping visitors understand what your site is all about. But sometimes, there are pages you’d prefer to keep tucked away. Maybe they’re only meant for certain users, or you want to keep them off search engines.

Fortunately, WordPress makes it easy to hide or restrict pages within your dashboard. Below are eight simple methods that actually work, so you can keep things private when you need to.

1. Set the page to private or password-protected

WordPress includes built-in visibility settings that let you hide a page from the public via the page editor or the Quick Edit feature. You can choose between two options: Private or Password-Protected.

Private pages

Users with an Administrator or Editor role can view a private page after logging into the WordPress dashboard. WordPress hides it from everyone else, even if they have the direct link. This works well for internal documentation or content meant just for team members.

To make a page private:

  1. Log in to your WordPress dashboard
  2. Go to Pages All Pages
  3. Click Edit on the page you want to hide
  4. In the right-hand Page settings panel, find Visibility 
  5. Click on the current status, then choose Private
  6. Click Update to save your changes

You can also do this via Quick Edit:

  1. In Pages All Pages, find the page you want to hide
  2. Click Quick Edit
  3. Look for the Password section
  4. Check the box labeled Private (ignore the Password field here)
  5. Click Update to apply the change

Password-protected pages

Just like it sounds, a password-protected page requires a password before anyone can view it. Unlike private pages, visitors can view a password-protected page without logging into WordPress or having a special user role — they just need the password you provide.

This is a good option if you want to share content with clients or customers who don’t have access to your site’s backend.

To password-protect a page:

  1. Open the page in the editor (just like when setting a page to private)
  2. In the Status & Visibility panel, select Password Protected
  3. Enter a secure password and copy it for safekeeping
  4. Click Update to apply the change

To do this using Quick Edit:

  1. Click Quick Edit on the page you want to protect
  2. Find the Password field
  3. Enter your chosen password and copy it for safekeeping
  4. Click Update to save your changes

2. Save the page as a draft or pending review

Another simple way to hide a page is to save it as a draft. WordPress does this automatically when you create a new page, unless you publish it. Draft pages stay hidden from the public; only users logged into your WordPress dashboard can see or edit them. Unlike private pages, users with roles like Author or Contributor may still have access, depending on permissions.

You can also mark a page as Pending Review. This status lets Authors or Contributors submit a page for review by someone with a higher role before publishing.

If you’re still working on a page or need to take it offline temporarily, switching it to Draft or Pending Review keeps it hidden while you make updates.

How to draft a page:

  1. Open the page in the editor
  2. In the Status & Visibility panel, find the Status option
  3. Click the current status and choose Draft or Pending Review
  4. Click Update to save your changes

To do this using Quick Edit:

  1. Go to Pages → All Pages
  2. Click Quick Edit on the page you want to change
  3. Find the Status field
  4. Select Draft or Pending Review
  5. Click Update to save

Once you do this, the page disappears from the front end but stays available in your dashboard. You can publish it again any time you’re ready.

3. Use a plugin to manage page access

If you want more control than the built-in tools available with WordPress, you can use a plugin. These tools let you restrict access based on user roles, membership levels, or even one-time payments.

This approach works especially well for membership sites or private client areas. You also get bonus features like usage reports, the ability to redirect unauthorized visitors to a custom page, and integrations with other popular plugins.

Popular plugins for content restriction

  • Content Control: Lets you restrict access to specific pages, posts, widgets, or even individual content blocks. You can set rules based on user role, login status, or device type, and even redirect users to different pages depending on their access level.
  • Ultimate Member: Focuses on user registration and profile management. It includes customizable forms with conditional logic, the ability to create custom user roles, member directories, and support for WooCommerce.
  • WP-Members: Gives you tools to block content from logged-out users, create custom registration fields, and manage user profiles. It also supports WooCommerce and sends admin notifications when someone registers.

4. Use CSS to hide the page from users

Want to do some light coding? You can hide specific pages from visitors using CSS — without needing to unpublish the pages, make them private, or change access settings. This works in both the Classic Editor and the Full Site Editor.

Find your page ID

Before adding any CSS, you’ll need the page ID of the content you want to hide. If you already have it, feel free to skip to the next section. Otherwise, follow these steps:

  1. Open the page in your browser
  2. Right-click anywhere on the screen and select Inspect
  3. In the <body> tag near the top of the code, look for a class like page-id-##
  4. Copy or write down the number (##)

Hiding your page with CSS

Once you have the page ID, you can add a simple CSS rule to hide the content from public view.

If your theme supports Additional CSS:

  1. In your dashboard, go to AppearanceEditor (Site Editor)
  2. Make sure you’re not editing a specific template
  3. Click the Styles 
  4. Scroll to the bottom and look for Additional CSS
  5. Paste this code (replace ## with your actual page ID):
body.page-id-## {

  display: none;

}
  1. Click Save to apply the change

Note: Some block-based themes don’t show the “Additional CSS” option. If that’s the case, you can use a plugin like Simple Custom CSS and JS instead.

Using the Simple Custom CSS and JS Plugin

  1. In your dashboard, go to Plugins → Add New
  2. Search for Simple Custom CSS and JS
  3. Click Install Now, then Activate
  4. Go to Custom CSS & JS → Add Custom CSS
  5. Give your snippet a title (e.g. “Hide Page ##”)
  6. In the main box, add the CSS code above
  7. Make sure there are no comments (text wrapped in /* */) in the snippet
  8. Click Publish to save your changes

This will hide the page’s content from view, but it won’t block access entirely. If someone has the link, they’ll still reach the page — they just won’t see anything when they get there.

5. Restrict access using user roles and code

Another way to control who can see specific pages on your WordPress site is by using a bit of PHP code inside your theme’s functions.php file. This file allows you to customize how your site behaves, such as hiding pages from users who aren’t logged in or who don’t have a specific user role.

AI

The most powerful AI tool for WordPress

Turn your ideas into ready-to-publish content at lightspeed.

Elevate your content

Safe coding practices

Editing functions.php directly can break your site if there’s even a small mistake (like a missing semicolon). So, before making changes:

  • Back up your site using a tool like Jetpack VaultPress Backup.
  • Don’t delete or overwrite anything unless you understand what it does.
  • Test your site after saving. You can fix something through FTP or your hosting file manager if something goes wrong.
  • For safer editing, use a plugin like Code Snippets. It lets you add custom PHP without touching core theme files and helps prevent your site from crashing if there’s an error.

Also, keep in mind that changes to functions.php only affect your current theme. If you switch themes, you’ll lose those modifications.

How to access your functions.php file

  • In the dashboard:
    • Site Editor: Go to Tools Theme File Editor
    • Classic Editor: Go to Appearance Theme File Editor
  • Via FTP, SSH, or your hosting control panel:
    • Navigate to /wp-content/themes/your-theme-name/functions.php

Example: Only allow access to a page for admins

  1. Open your functions.php file
  2. Scroll just past the opening <?php and any comments or require_once() lines
  3. Paste the following code (replace ## with your actual page ID):
add_action('template_redirect', function() {

if (is_page(##) && !current_user_can('administrator')) {

     wp_redirect(home_url());

     exit;

}

});
  1. Click Update File to save your changes

This snippet checks if a visitor is trying to view the page with that ID. WordPress will redirect them to your homepage if they’re not an administrator.

6. Remove the page from navigation menus

As your website grows, adding pages can clutter your navigation menus. This can make it harder for visitors to find what they’re looking for. While dropdown menus help organize things, sometimes it’s easier just to hide a page that isn’t essential. Here’s how to do that:

Manual menu removal

  1. In your WordPress dashboard, go to Appearance → Menus
  2. If you have multiple menus, select the one you want to edit
  3. Find the page you want to hide and click the arrow next to it to expand the settings
  4. Click Remove
  5. Click Save Menu to apply the changes

Using a plugin

If you’d prefer not to edit your menus each time manually, you can use a plugin like Max Mega Menu. These plugins give you more control over how your menus look and which pages appear in them, utilizing a visual interface.

7. Use SEO plugins to hide pages from search engines

If your goal is to keep a page off Google or Bing — not hidden from users, but out of search results — an SEO plugin is one of the easiest ways to make this happen. These tools give you simple options to control how search engines treat individual pages, right from your editor.

Using Yoast SEO

Yoast SEO is one of the most widely-used WordPress plugins, and the features you need to hide your page from search engines are included in the free version. Here’s what to do:

  1. Install and activate the Yoast SEO plugin
  2. Go to the page you want to hide and click Edit
  3. Scroll to the Yoast SEO box below the content
  4. Click the Advanced tab (if it’s not visible, you may need to enable advanced settings in Yoast’s configuration)
  5. Under Allow search engines to show this Page in search results?, choose No
    1. Optionally, set Should search engines follow links on this Page? to No as well
  6. Click Update to save your changes

This tells search engines not to index the page (a noindex directive), so it doesn’t appear in search results. Keep in mind that this doesn’t remove a page that’s already indexed, but it does stop it from being crawled again.

You can also use other popular plugins like Rank Math or All in One SEO to apply the same noindex settings. As long as the directive is added, search engines should honor it and exclude the page from their results.

8. Block search engine crawlers with robots.txt

Another way to prevent search engines from crawling specific pages is to use the robots.txt file. This file doesn’t physically block access, but it gives search engines instructions on how to treat your site’s content.

Keep in mind that if a page is already indexed, adding it to robots.txt won’t remove it from search results, but it can stop further crawling.

By default, you can only access robots.txt through FTP, SSH, or your hosting provider’s file manager. However, SEO plugins like the ones mentioned earlier also let you edit a virtual robots.txt file directly from your WordPress dashboard.

How to edit robots.txt:

  1. Access your site files using FTP or your hosting file manager
  2. Open or create a file named robots.txt in the root directory
  3. Add this line to block a page (replacing /your-page-slug/ with the actual URL slug of the page you want to block):
User-agent: *

Disallow: /your-page-slug/
  1. Save and upload the file

Final thoughts on hiding WordPress pages and posts

Just as there are many reasons to hide or restrict certain pages in WordPress, there are many ways to accomplish this task. The best method will depend on your end goal and should be one that you’re technically comfortable with. 

The options in this guide give you flexible tools to handle a range of needs. In many cases, combining methods — like removing a page from menus and setting it to noindex — offers even more control.

Bring hidden pages to life with Jetpack AI Assistant

Hiding a WordPress page gives you the time and space to fine-tune your content. Maybe you’re polishing something for a future launch or reviewing documentation not quite ready for the spotlight. This is where Jetpack AI can help.

Jetpack AI Assistant lets you edit faster and write more clearly, right from your WordPress editor. It’s especially useful when you’re working on pages that are still under wraps.

Here’s how Jetpack AI can help you achieve your content goals:

  • Refine tone and clarity: Whether you want to make a draft easier to read or align it with a specific voice, the assistant can rewrite sections to match your goals.
  • Tidy up structure: If the layout feels rough, ask it to help reorganize headings or smooth out transitions.
  • Work through tough spots: Not sure how to phrase something? Need a clearer intro? You can ask the assistant for ideas or alternate wording.
  • Translate or localize content: Preparing something for a global audience? The assistant supports several languages and can help adapt your content accordingly.
  • Summarize or enhance sections: For landing pages, internal docs, or client resources, it can create quick summaries, callouts, or alternate headlines.

You can also just ask questions as you work — like how to format an FAQ or what to include in a changelog — and get helpful suggestions in return.

If you’re already using Jetpack, the assistant is just a few clicks away and works natively with the block editor. It’s a low-effort way to level up your content while it’s still behind the scenes.

This entry was posted in WordPress Tutorials. Bookmark the permalink.
WordPress Tutorials

Jen Swisher profile

Jen Swisher

Jen is a Customer Experience Specialist for Jetpack. She has been working with WordPress and Jetpack for over a decade. Before starting at Automattic, Jen helped small businesses, local non-profits, and Fortune 50 companies create engaging web experiences for their customers. She is passionate about teaching others how to create on the web without fear.

AI

The most powerful AI tool for WordPress

Turn your ideas into ready-to-publish content at lightspeed.

Elevate your content

Have a question?

Comments are closed for this article, but we're still here to help! Visit the support forum and we'll be happy to answer any questions.

View support forum