How to Noindex a Page Using Meta Tags and HTTP Headers
Discover how to noindex a page using HTML meta tags or HTTP response headers to remove unwanted URLs from search engine results.
To learn how to noindex a page, add the tag <meta name="robots" content="noindex, follow"> inside the HTML <head> section of that document, or return an X-Robots-Tag: noindex HTTP response header from your web server. Google and other search engines will read the directive on their next crawl and drop the URL from search listings. If you need the URL removed from search results immediately while waiting for that crawl, submit a temporary removal request in Google Search Console.
Choosing the right noindex method
You can tell search engines to drop a URL in two primary ways: an HTML meta tag or an HTTP response header. Picking the right one depends on your tech stack and the file type you want to hide.
- HTML Meta Tag: Best for standard web pages where you have direct access to template code or your content management system. You insert a line of HTML into the document head.
- X-Robots-Tag Header: Necessary for non-HTML files such as PDFs, spreadsheets, images, and text documents. It is also cleaner if you manage URL patterns at the server level via Apache, Nginx, or Cloudflare.
- Google Search Console Removals Tool: This does not technically apply a noindex directive. Instead, it hides a page from Google search results for roughly six months. It gives you immediate relief while you wait for search bots to recrawl your permanent meta tag or header.
If you aren't sure which snippet fits your environment, you can use the Free Noindex Tag Generator to produce the exact meta tag or server header rule without syntax mistakes.
How to generate a noindex tag with an online tool
Generating the markup manually is prone to typos that invalidate the rule. Using a dedicated generator lets you specify what should happen to links on the page and grab the snippet tailored to your platform.
- Go to the Noindex Tag Generator on Links to Wild.
- Specify the page type and select whether you want search crawlers to follow the links on the page (almost always recommended as
noindex, follow). - Select your output format, choosing between a standard HTML meta tag or an
X-Robots-Tagheader rule for Apache or Nginx. - Copy the generated code snippet directly to your clipboard.
- Paste the snippet into the page template or server configuration file.
How to noindex a page in WordPress
WordPress users can add noindex directives either through common SEO plugins or directly in the theme template files.
Using Yoast SEO
- Open the post or page in the WordPress editor.
- Scroll down to the Yoast SEO settings box below the content area, or click the Yoast icon in the top right sidebar.
- Expand the Advanced tab.
- Under "Allow search engines to show this Page in search results?", select No.
- Update or publish the page.
Using Rank Math
- Open the post or page in the block editor.
- Click the Rank Math score icon in the top right toolbar to open the SEO panel.
- Click the Advanced icon (the wrench symbol).
- Check the box for No Index. Leave No Follow unchecked so search bots can still crawl outbound links from this page.
- Save or update the post.
How to noindex a page in WordPress without a plugin
If you run a lightweight WordPress site without an SEO plugin, you can inject the tag conditionally through your child theme's functions.php file:
- Open your WordPress admin and navigate to Appearance > Theme File Editor, or access your theme files via SFTP.
- Open your child theme's
functions.phpfile. - Add a hooked function targeting the specific page ID or slug:
add_action('wp_head', function() { if (is_page('thank-you') || is_page(123)) { echo '<meta name="robots" content="noindex, follow">' . "\n"; } }); - Save the file and check the page source in your browser to verify the tag rendered in the
<head>block.
How to noindex a page in Shopify
Shopify does not provide a native checkbox in the admin dashboard to hide pages from search engines. You must add Liquid code to your theme.
- From your Shopify admin, go to Online Store > Themes.
- Click the three dots next to your active theme and select Edit code.
- Under the Layout folder, click
theme.liquid. - Locate the opening
<head>tag near the top of the file. - Paste a conditional block that targets the URL handle or template you want to hide. For example, to hide a page with the handle
secret-sale:{% if handle contains 'secret-sale' %} <meta name="robots" content="noindex, follow"> {% endif %} - Click Save in the upper right corner.
How to add an X-Robots-Tag via server configuration
When you need to keep PDF documents, download files, or entire directories out of search results, you must serve the directive as an HTTP header rather than an HTML tag.
Apache (.htaccess)
- Open the
.htaccessfile in your site root directory using a text editor or SFTP client. - To apply noindex to all PDF files on the site, add the following directive:
<FilesMatch "\.pdf$"> Header set X-Robots-Tag "noindex, follow" </FilesMatch> - To apply it to an individual URL or directory, use:
<Location "/private-folder/"> Header set X-Robots-Tag "noindex, follow" </Location> - Save the file and test the response headers using a command line tool like
curl -I https://example.com/file.pdf.
Nginx
- Open your domain server block configuration file (often located in
/etc/nginx/sites-available/). - Inside the
serverblock, add a location directive matching your files or path:location ~* \.pdf$ { add_header X-Robots-Tag "noindex, follow"; } - Test your syntax by running
sudo nginx -tin the terminal. - Reload Nginx using
sudo systemctl reload nginx.
Common mistakes that stop a noindex tag from working
When a page refuses to drop out of search results after adding a directive, the issue is almost always caused by one of four technical conflicts.
1. Blocking the page in robots.txt
This is the most frequent error. If your robots.txt file contains a Disallow: /example-page rule, search engine crawlers cannot load the page. Because they cannot load the page, they never see your noindex meta tag or HTTP header. Search engines will then keep the URL indexed as a bare listing based on external or internal links. If you need help reviewing your file, check our guide on how to check robots.txt, or test your rules against our Robots.txt Tester.
2. Canonical tags pointing to a different page
If page A contains a noindex tag but also has a rel="canonical" tag pointing to page B, you are sending contradictory signals. One signal says "ignore this page," while the other says "this page is an alternative version of page B." Google may ignore the noindex directive or choose to ignore the canonical. Run your URL through the Canonical Tag Checker to identify conflicting signals before deploying them.
3. Serving noindex via client-side JavaScript
Inserting a noindex meta tag dynamically through JavaScript or Google Tag Manager is unreliable. Search engines must run a secondary rendering pass to execute client-side scripts. If the crawler processes the raw HTML response first, or if the rendering pass fails, the noindex directive will never register. Always serve indexing directives directly in the raw server response.
4. Using robots.txt to hide staging environments
Site owners frequently try to hide staging sites using a blanket Disallow: / in robots.txt or a site-wide noindex tag. A robots.txt file is publicly visible and acts as a directory map to anyone looking for staging URLs. If a staging environment is reachable without authentication, external links or browser data will eventually cause it to be indexed. Protect staging environments with HTTP basic authentication or an IP allowlist, not directives.
How to check if the noindex tag works
Never assume an indexing tag is active until you verify the raw response code that the search engine receives.
- View the raw HTML source: In your browser, open the URL and press
Ctrl+U(orCmd+Option+Uon a Mac) to view the page source. PressCtrl+Fand search fornoindex. Confirm that the tag is located between the<head>and</head>tags, not inside the<body>. - Inspect the URL in Google Search Console: Paste the full URL into the top search bar in Search Console. Click Test Live URL. Once the test finishes, click View Tested Page and examine the HTML tab. Search for
noindexto verify that Google's crawler received the directive during its live fetch. - Verify HTTP headers: For PDFs or header-based rules, open your terminal and run
curl -I https://example.com/document.pdf. Inspect the output lines forX-Robots-Tag: noindex, follow.
Frequently Asked Questions
How long does it take for a noindex tag to remove a page from Google?
It takes as long as it takes Google to recrawl the URL. For a page that receives consistent organic traffic and internal links, recrawling usually happens within several days. For an isolated page that receives little to no traffic, it can take weeks or months. While you cannot force Google to crawl immediately, you can request indexing for the URL in Search Console, or use the Search Console Removals tool to temporarily hide the listing while waiting for the crawler to process the permanent tag.
Should I use noindex or robots.txt?
Use noindex when a page must not appear in search results. Use robots.txt when a page can appear in results if discovered, but is not worth crawling, such as infinite faceted navigation filters, internal search results, or server-heavy calendar views. Never use both on the exact same URL. A robots.txt disallow rule blocks the crawler from fetching the page, preventing it from ever reading the noindex instruction.
Does noindex, nofollow pass any link value?
No, and using nofollow alongside noindex is rarely what you want. Using noindex, follow allows search bots to continue crawling through outbound links on the page while dropping the URL itself from search results. Adding nofollow turns the page into a dead end for crawlers. Over time, Google typically begins treating long-term noindexed pages as if they were nofollow anyway, so you should not rely on a noindexed page as a permanent conduit for internal link equity.
Can I make a page noindex in HubSpot?
Yes. In your HubSpot portal, navigate to your Website Pages or Landing Pages list. Hover over the page and click Edit. In the content editor, click Settings at the top, select Advanced options, and locate the Head HTML field. Insert <meta name="robots" content="noindex"> directly into that block, then publish or update the page.
How do I find all noindex pages on my website?
The easiest way to audit noindex pages across your site is via Google Search Console. Navigate to the Pages report under the Indexing section. Look in the table under "Why pages aren't indexed" for the row labeled Excluded by 'noindex' tag. Clicking that row provides a list of all URLs Google has crawled that currently return a noindex directive. You can also run a site crawl using desktop auditing software to locate every page returning the tag in its HTML or headers.