Seo Blog

Handling noindex and nofollow tags in WordPress

When it comes to search engine optimization (SEO), one of the fundamental aspects to consider is the control over the indexing of a 
website ‘s pages . There are times when it may be necessary to hide certain pages from search engines, such as login pages, restricted pages, or sections under development. This is possible thanks to the robots meta tags , in particular the noindex and nofollow tags.

In this specific case, the client’s website, which recently requested my SEO services , was unable to be indexed in Google. After a quick check of the code and a further check in Google Search Console, we found that the robots meta tag within the pages showed this code:

<meta name='robots' content='noindex,nofollow' />

Of course, Google did not index the pages accordingly.

In this article, we will see how to add or remove noindex tags in WordPress , using different solutions. We will also discuss the nofollow tag and how both tags can affect the indexing of your site’s pages .

Table of Contents

What is the noindex tag and when to use it

The WordPress robots noindex tag is an attribute that is inserted into the HTML code of a page and is used to prevent a page of the site from being indexed by search engines.

What is this tag used for? It is often used for:

  • Reserved pages (login, user pages)
  • Duplicate content
  • Temporary or under construction pages
  • Resources that should not be visible in search results

How to Add Noindex Tag in WordPress

There are several methods to add noindex tags in WordPress . Here are two of the most common:

WordPress Settings

In your WordPress admin panel, click on “ Settings ” then “ Reading ” and scroll down to “Search Engine Visibility”. Click on “Discourage search engines from indexing this site”.

In the code, the robots meta tag will be changed to “noindex,nofollow”.

Conversely, uncheck the checkbox to remove “noindex”.

Using an SEO plugin like Yoast SEO

Yoast SEO is one of the most used plugins for managing SEO on WordPress. One of its main features is the ability to manage robots meta tags , including noindex and nofollow .

  1. Install Yoast SEO : If you haven’t already, install and activate Yoast SEO.
  2. Accessing a single page : Go to the Pages or Posts section and edit the page where you want to add the noindex tag.
  3. Yoast SEO Section : Scroll down until you find the Yoast SEO section.
  4. Advanced Settings : Under the “Advanced” tab, you will find the option “Allow search engines to show this page in search results?”. Select “No” to add the noindex tag.
  5. Save Changes : After selecting the option, save the page. Now the tag will be added to the source code of the page.

With this method, your site page will be excluded based on the WordPress noindex tag and will not appear in search results.

Manually editing the HTML code

If you prefer to edit the HTML code directly , you can manually insert the meta name tag robots content noindex nofollow WordPress in the head section of the page .

Access your WordPress theme : Go to Appearance > Theme Editor.

Editing the header.php file : Find and edit the header.php file. This file contains the head section of the page .

Adding the meta tag : Insert the following code inside the <head> tag of the page you want to exclude from indexing:

<meta name="robots" content="noindex, nofollow">

This will prevent both the indexing of the page and the following of links on it.

This method is more technical, but gives you full control over where and how to place your robots meta tags .

How to Remove Noindex Tag in WordPress

If a page has previously been excluded based on the WordPress noindex tag , you may want to remove this tag in the future to index the page . Again, Yoast SEO and manually editing the source code are two valid options.

Remove noindex tags with Yoast SEO

  1. Go to the page in question .
  2. Go to the Yoast SEO section .
  3. Advanced Settings : In the Advanced tab, set “Allow search engines to show this page in search results?” to “Yes”.
  4. Save the page .

Now the page will be indexed by search engines and may appear in the results.

Manual Edit

If you manually inserted the noindex tag , you need to remove it from the page’s HTML code . Go back to the header.php file or the page template and delete the line containing the tag:

<meta name="robots" content="noindex, nofollow">

Alternatively, you can change it to:

<meta name="robots" content="index, follow">

This will allow search engines to index your pages and follow internal and external links.

How to remove nofollow tags in WordPress

The nofollow tag is used to tell search engines not to follow links on a page or to pass authority from an internal or external link to other pages on other websites.

If you have used the nofollow tag for a specific link and want to remove it, there are two ways:

SEO Plugins like Yoast SEO

Similar to what we saw for the noindex tag , you can use Yoast SEO to manage the nofollow rel attribute .

  1. Editing the link : Go to the page and find the link you nofollowed .
  2. Changing settings : In the link management window, uncheck the “Add rel=”nofollow” to links” option.
  3. Save changes .

Manually editing the code

To remove the nofollow tag manually, you need to access the HTML code of the page and find the link that contains the attribute:

<a href="URL" rel="nofollow">Link Anchor Text</a>

Remove the rel=”nofollow” attribute , leaving the link intact:

<a href="URL">Link Anchor Text</a>

This will allow search engines to follow the link and pass SEO value to the linked site.

Difference between noindex and nofollow

A common mistake is to confuse the two tags. Noindex is used to prevent search engines from indexing your pages , while nofollow is applied to links and tells search engines not to follow them. You can use these tags together or separately, depending on your needs.

For example, a typical meta name robots content noindex follow indicates that the page will not be indexed, but the links on it will be followed by search engines.

Other solutions to control indexing

In addition to the robots meta tags , you can control the indexing of your pages using the robots.txt file , which tells search engines which sections of your website should not be crawled.

For example, if you want to exclude a certain page from all search engines, you can use this code in your robots.txt:

User-agent: *
Disallow: /page-to-exclude/

However, the robots.txt file does not always guarantee that a page will be excluded from search results; for this reason, it is often recommended to combine the use of meta name robots content noindex nofollow with the robots.txt file .

For more tips read How to stop Google from indexing a web page?

Questions and Answers

What is the noindex tag? The noindex tag tells search engines not to index a page.

When should I use the noindex tag? Use it for restricted pages, duplicate content, or temporary pages.

How can I add the noindex tag in WordPress? You can use a plugin like Yoast SEO or manually add the tag in your HTML code.

What does the nofollow tag do? It prevents search engines from following links on a page.

How can I remove a noindex tag from a WordPress page? Through the Yoast SEO plugin or by editing the HTML code of the page.

Does the noindex tag also block the page from being crawled? No, the page can be crawled but will not be indexed.

Can I use noindex and nofollow together? Yes, to prevent both indexing and following of links.

Can robots.txt replace the noindex tag? Not completely. Robots.txt can block crawling, but not always indexing.

Can I remove the nofollow tag from a WordPress link? Yes, either through Yoast SEO or manually from the HTML code.

How do I check if a page has the noindex tag? Check the source code or use tools like Google Search Console.

Sign up for the newsletter. Stay updated!

We will send you periodical important communications and news about the digital world. You can unsubscribe at any time by clicking the appropriate link at the bottom of the newsletter.

Dopstart

Dopstart è il sito di Paolino Donato ma anche il suo Nickname su Internet. Dopstart è un consulente SEO. Si occupa di posizionamento nei motori di ricerca fin dal 1998. Dal 2010 ha collaborato con Google in qualità di TC per Google News italiano e Google Noticias per i Paesi di Lingua spagnola e dal 2018 come Product Expert vedi curriculum

Share
Published by
Dopstart

Recent Posts

Google Says Goodbye to Sitelinks Search Box

Starting November 21, 2024, Google will remove the sitelinks search box from search results to…

1 day ago

How to Turn Google Photos Backup On and Off

How to backup Google Photos from your phone and PC Google Photos backup is one of the…

2 days ago

How to replace “&amp%3B” in “&” from a script URL

A customer asked to implement a third-party service on his website under our site management (in this…

2 weeks ago

How to add users to Google Analytics (GA4)?

Google Analytics: Is adding a user difficult for you? I'll explain how to add users…

3 weeks ago

How to Add Users to Google Search Console

Google Search Console is an essential tool for anyone who manages a website, allowing you to…

3 weeks ago

Search Engine positioning

https://youtu.be/XltdeciM1Pc Learn how to optimize your positioning on Google, Bing, YouTube, Amazon and social media…

3 weeks ago