How To Hide A Page In WordPress

There may be times when you want to hide a specific page from your WordPress site’s navigation menu, search results, or even prevent unauthorized users from accessing it. This blog post will guide you on how to hide a page in WordPress using different methods.

Method 1: Exclude the Page from Navigation Menu

If you simply want to hide the page from your site’s navigation menu, you can easily do this from the WordPress menu settings. Follow these steps:

  1. Go to the Appearance > Menus in your WordPress dashboard.
  2. Select the menu you want to edit or create a new menu.
  3. Remove the page you want to hide by clicking the arrow next to the page title and then clicking on the Remove link.
  4. Click Save Menu to save your changes.

Note that this method only hides the page from the menu, it will still appear in search results and can be accessed directly via the URL.

Method 2: Hide the Page Using a Plugin

Another way to hide a page in WordPress is by using a plugin. In this example, we’ll use the WP Hide Post plugin. Here’s how to do it:

  1. Install and activate the WP Hide Post plugin.
  2. Edit the page you want to hide.
  3. On the right side of the editor, look for the Hide Posts meta box.
  4. Check the options you want to apply, such as hiding the page from search results, archives, or the front page.
  5. Update or publish your page to save your changes.

Using this method, you can control the visibility of your page on various parts of your WordPress site.

Method 3: Password Protect the Page

If you want to prevent unauthorized users from accessing the page, you can password protect it. To do this, follow these steps:

  1. Edit the page you want to protect.
  2. On the right side of the editor, look for the Publish meta box.
  3. Click on the Visibility link and select Password Protected.
  4. Enter a password for the page and click OK.
  5. Update or publish your page to save your changes.

Now, when someone tries to access the page, they will be prompted to enter a password.

Method 4: Hide the Page Using Custom CSS

This method involves hiding the page link from your navigation menu using custom CSS. Here’s how to do it:

  1. Find the page ID by going to Pages > All Pages in your WordPress dashboard, then hover over the page title and note the ID value in the URL.
  2. Go to Appearance > Customize, then click on Additional CSS.
  3. Add the following CSS code to the editor, replacing your_page_id with your actual page ID:
    .menu-item-your_page_id {
        display: none;
    }
    
  1. Click Publish to save your changes.

Note that this method only hides the page from the menu and can still be accessed directly via the URL.

Conclusion

There are several ways to hide a page in WordPress, and the method you choose depends on your specific needs. Whether you want to exclude the page from the navigation menu, hide it from search results, password protect it, or use custom CSS, this guide has you covered. Choose the method that works best for you and customize your WordPress site accordingly.