If you want a specific page on your website, such as a staging page, a thank-you page, or an admin login screen, to stay out of Google's search results, you need a noindex tag. This tells search engines they can visit the page but should not list it in search results. It is different from blocking a page in your robots.txt file, which only stops crawling and does not reliably keep an already-indexed page out of search results.
Two ways to add a noindex tag
Option 1: Add a meta tag to the page's HTML
- Open the page you want to hide from search results in your website's editor, or in your hosting account's File Manager if you edit HTML files directly.
- Find the <head> section of the page's HTML.
- Add this line inside it: <meta name="robots" content="noindex, follow">
- Save the file, and upload it back to your website if you edited it on your computer.
The follow part tells Google it can still follow links on that page to other pages on your site, even though it will not list this particular page.
Option 2: Use an HTTP header for non-HTML files
Meta tags only work on HTML pages. If you need to keep a PDF, an image, or another file type out of search results, add an HTTP header instead using your website's .htaccess file.
- Open File Manager in your hosting control panel and locate the .htaccess file in your website's root folder.
- Add a line like this: Header set X-Robots-Tag "noindex, nofollow"
- To target just one file rather than your whole site, wrap the line in a <Files> block naming that specific file.
- Save the file.
Editing .htaccess works the same way whether you are on cPanel or DirectAdmin, since it is a standard Apache configuration file used by both.
If your website runs on WordPress
You do not need to edit code by hand. Most SEO plugins, such as Yoast SEO or Rank Math, add a noindex toggle to every page and post's editor screen, usually under an SEO or Advanced tab.
WordPress also has a site-wide setting worth checking, especially on a new site. Go to Settings, then Reading, and make sure Discourage search engines from indexing this site is unchecked once your site is ready to go live. This checkbox is commonly left on by accident after building a site, and it keeps the entire website out of Google.
Adding a noindex tag will not remove a page that is already indexed right away. Google needs to recrawl the page first, which can take anywhere from a few days to a few weeks. If a page needs to come down from search results urgently, you can request removal directly through Google Search Console.
For more on controlling what search engines can access on your site, see What Is a robots.txt File and How Do You Use It?