🚀 daydream acquires Positional (YC S21)

How To Noindex URLs In WordPress: A Step-by-Step Guide

Learn how to easily noindex specific URLs in WordPress to prevent them from appearing in search engine results with this step-by-step guide.

October 17, 2024
Written by
Matt Lenhard
Reviewed by

Join 2,500+ SEO and marketing professionals staying up-to-date with Positional's weekly newsletter.

* indicates required

If you have a WordPress website, there may come a time when you don’t want certain pages or posts to appear in search engine results. There could be several reasons for doing this, such as duplicate content issues, protecting private pages, or preventing low-quality content from affecting your search engine ranking. The solution to this is applying a “noindex” tag to the appropriate URLs. This guide will explore various methods you can use to accomplish that in WordPress.

What Does “Noindex” Mean?

Before diving into the steps, it’s important to understand what “noindex” does. Simply put, a “noindex” meta tag tells search engines like Google and Bing not to index a specific page or post. While search engines can still technically ‘crawl’ the page, they won’t include it in their search results. It’s a useful tool when you want to limit the visibility of certain pages without making them private.

Reasons to Use Noindex in WordPress

There are several scenarios in which you might want to noindex certain WordPress URLs:

  • Duplicate content: If you've got multiple pages with similar or duplicated content, noindexing some of them can prevent search engine penalties.
  • Low-quality pages: Pages with little content or ones that don't add much value for users should be noindexed to prevent them from negatively impacting SEO performance.
  • Private Pages: Certain pages, like login, thank you pages, or checkout pages, should be noindexed since you don’t want them showing up in search results.
  • Tag and Category Archives: WordPress creates individual archive pages for tags and categories, which may not provide valuable content for users. Noindexing these pages can improve your SEO strategy.

Now that we know why noindexing is important, let’s explore how to do it in WordPress.

Steps to Noindex URLs in WordPress

There are a few methods to add noindex to different URLs in WordPress. Let’s break this down into several options, and you can choose the most appropriate method based on your needs:

Method 1: Using an SEO Plugin (Yoast SEO)

One of the easiest ways to noindex URLs in WordPress is by using a popular SEO plugin like Yoast SEO. This plugin offers a wide range of features for managing your website’s SEO, including adding noindex tags to specific posts, pages, or archives.

Follow these steps to noindex a post or page using Yoast SEO:

  1. Install and activate the Yoast SEO plugin from your WordPress dashboard.
  2. Go to the post or page you want to noindex.
  3. Scroll down to the Yoast SEO meta box (typically found below the text editor).
  4. Click the “Advanced” tab.
  5. In the section “Allow search engines to show this Post in search results?”, select “No.”
  6. Update or publish your post/page.

If you'd like, you can also use Yoast SEO to noindex entire archive pages, tag pages, categories, or author pages:

  1. Go to the Yoast SEO settings by clicking on the "SEO" tab in your WordPress dashboard menu.
  2. Navigate to “Search Appearance”.
  3. Select the “Archives”, “Categories” or “Tags” tabs, based on what you want to noindex.
  4. Find the option “Show in search results?” and set it to “No.”
  5. Save your changes.

Method 2: Using Rank Math SEO Plugin

Another powerful SEO plugin that lets you easily noindex WordPress URLs is Rank Math. Here’s how you can do it:

  1. Install and activate Rank Math from the WordPress plugin repository.
  2. Navigate to the post or page you want to noindex.
  3. Scroll down to the Rank Math SEO meta box and click on the “Advanced” tab.
  4. Find the option that says “Robots Meta” and check the box that says “Noindex.”
  5. Publish or update the post.

You can also use Rank Math to noindex archives, tags, and categories:

  1. Go to Rank Math settings by clicking “Rank Math” in the dashboard menu.
  2. Navigate to the “Titles & Meta” settings.
  3. Under the "Post Types", "Categories" or "Tags" tabs, look for the “Robots Meta” section.
  4. Choose “Noindex” for the appropriate sections.
  5. Save your changes.

Method 3: Manual Noindex via Code

If you’re comfortable editing your theme’s code, you can manually add a noindex tag to certain sections of your WordPress site.

Here’s a simple example of adding a noindex tag to a specific URL:

  1. Go to the WordPress dashboard and navigate to Appearance > Theme Editor.
  2. Locate the template file where the content is generating (for example, single.php for single posts or page.php for pages).
  3. Add the following code inside the <head> section of your HTML:
  4. <meta name="robots" content="noindex, follow">
  5. Save the changes and see if the noindex tag is working correctly by viewing the page source of the relevant URL.

Remember, this method requires caution as modifying your theme’s files could break your site if done incorrectly. Always backup your site before making important changes, and consider using a child theme to avoid overwriting your customizations during future updates.

Method 4: Noindex Using robots.txt

WordPress automatically generates a robots.txt file, which acts as a set of instructions for search engine bots. You can modify this file to noindex or block certain URLs.

To noindex a URL using the robots.txt file, follow these steps:

  1. Install a plugin like Virtual Robots.txt, or use a file manager plugin to access your robots.txt file.
  2. Open the robots.txt file and add the following lines:
  3. User-agent: *
    Disallow: /your-page-url/
    
  4. Replace /your-page-url/ with the specific URL path you want to block.
  5. Save and upload the file.

Note that this approach only ensures that search engines won’t crawl that page. Adding a noindex attribute directly to the site is generally more effective since using robots.txt only disallows crawling but doesn't completely guarantee the URL will not show in search results.

Common Noindex Use Cases

It's essential to know when and where to apply the "noindex" attribute for the best results. Here are some common use cases where you might want to apply a noindex:

Page Type Reason for Noindexing
Login Pages These pages don't provide useful content to general users and can become security vulnerabilities if indexed.
Thank You Pages Post-conversion pages should remain hidden from search engines to prevent skewed analytics and fraudulent activities.
Admin Pages Obviously, you don’t want search engines indexing back-end pages.
Duplicate Content Helps avoid having repetitive or similar content reduce your site's overall SEO value.

Conclusion

Noindexing specific pages or posts on your WordPress site can prevent them from showing up in search results, ensuring that your valuable SEO juice is funneled to more important content that will help your site rank well. Using tools like Yoast SEO or Rank Math makes it easy for even novice users, while more advanced users can opt for custom code or robots.txt modifications. Remember to always carefully assess which pages you want to hide from search engines to maximize your SEO strategy.

Lastly, make sure to regularly check Google Search Console to ensure your noindex commands are being respected and to monitor how search engines are interacting with your site.

Matt Lenhard
Co-founder & CTO of Positional

Matt Lenhard is the Co-founder & CTO of Positional. Matt is a serial entrepreneur and a full-stack developer. He's built companies in both B2C and B2B and used content marketing and SEO as a primary customer acquisition channel. Matt is a two-time Y Combinator alum having participated in the W16 and S21 batches.

Read More

Looking to learn more? The below posts may be helpful for you to learn more about content marketing & SEO.