How to Remove WordPress Robots Meta Tag noindex, nofollow

Having trouble getting your WordPress website crawled or indexed in search? You recently install WordPress setup manually into your online hosting service. When you log in to Google Search Console and request indexing are you being met with all sorts of error messages about noindex / nofollow meta tags.

How to Remove WordPress Robots Meta Tag noindex, nofollow

We will show you how to remove meta name=’robots’ content=’noindex nofollow’ in WordPress using replace some code inside the admin panel, no plugin request, if you are technical know-how to modify codes or script that make you very easy, otherwise no problem in this blog post I make very easier only you can follow this bellow mention with reference images, that helps you to resolve them.

Step 1 – Log into your cPanel

Now the first step you can work with the files in your cPanle account prefer a web-based alternative, there is a File Manager built into cPanel.

To access the File Manager, log in to your hosting cPanel and go to cPanel by clicking the “cPanel Login” button.

Log into your cPanel

Step 2 – cPanel File Manager

Now that you want to log in to the file manager. In the “FILES” section, click the “File Manager” link or icon.

When you log in to the File Manager, you will be in the root directory for your account. Most of the time you’ll be working with website files, and they are located in the “public_html” directory.

File Manager located in the public_html

Step 3 – Find file Name as wp-includes

Well, you log inside the public_html directory, now you find a folder, name wp-includes, double click to open this folder. At the same time, there are so many folders and files, take a breath, and simply click to your keyboard Ctrl+f and type general-template.php.

Now you find file name general-template.php, and download this file to your system, check the below image for reference.

Find file name general-template.php

Step 4 – Edit general-template.php File

You can find these two different function, how to find function, so file open with a text editor to your desktop computer, now find (Ctrl+f) this line bellow mention:

  • 1 – Find this first code and replace with just bellow this:
function wp_no_robots() {
	if ( get_option( 'blog_public' ) ) {
		echo "<meta name='robots' content='noindex,follow' />\n";
		return;
	}

	echo "<meta name='robots' content='noindex,nofollow' />\n";
}
Replace first code to this bellow reference code
  • 1.1 – Replace first with this code:
function wp_no_robots() {
	if ( get_option( 'blog_public' ) ) {
		echo "<meta name='robots' content='index,follow' />\n";
		return;
	}
	echo "<meta name='robots' content='index,follow' />\n";
}
Replace first with this code
  • 2 – Find this second code:
function wp_sensitive_page_meta() {
	?>
	<meta name='robots' content='noindex,noarchive' />
	<meta name='referrer' content='strict-origin-when-cross-origin' />
	<?php
}
Find this second code
  • 2.2 – Replace Second with this code:
function wp_sensitive_page_meta() {
	?>
	<meta name='robots' content='index,archive' />
	<meta name='referrer' content='strict-origin-when-cross-origin' />
	<?php
}
Replace Second with this code

Well, you replace this code to our reference code, that make your website give SEO boost, Google suggests to focus and web page indexing.

Step 5 – Uploading general-template.php File in File Manager

Click Upload from the top toolbar. This brings a new tab open screen, then click on the select button, it appears for you to locate the file on your local computer. Once you find the desired file, click on the Open button to begin the upload.

Uploading general-template.php File in File Manager

Once that is complete, go back to the website check, change into Search Console, resubmit the URL you tried earlier. If you are replacing all codes properly, everything should be singing a different tune. Now when you submit a URL, the URL inspection report should be void of all warnings and error messages, at least ones related to indexing and crawl ability, and you’ll be able to “Request Indexing,”.

I hope that helps, Google suggests to focus and web page index on search engine Googlebot through your site. This means your website should have intuitive navigation and clear URLs.

Note: WordPress Dashboard upgrade or update; this code can replace into noindex, nofollow (as par wordpress.org provide dashboard codes); at the time you will follow the same, replace code.

You may also want to see our tips on how to secure WordPress site guide & tips or How to Add Title Tag for all WordPress Images Solve in One Step Image SEO Optimize.

18 Comments

  1. Hey Dipankar,

    I am still unable to remove the noindex thing:

    this i have copied from my page’s ‘view page source’ and google search console still gives the same result.

    Please help

    1. Hello Parth,

      You must follow the step no.4 (Step 4 – Edit general-template.php file).

      After replacing code, save the file.

      Now, you open browser, clear cache and “view page source”; find (Ctrl+f) {meta name=’robots’}.

      If you find (index,follow), Ok;

      Now, Google Search Console – Inspect any URL in the current resource – Test live URL (on the right side)

      Solve “URL is available to Google”.

      1. Hello Dipankar,
        I have already executed step 4

        this is the result
        I am really afraid if i will be able to solve it.
        I tried deleting that particular page and replacing it with a new copy but again the same result.
        Please help

      2. i just now discovered that i was checking the source page of the category page and it was marked as ‘noindex’, but when i went into a particular post of that same category then the source page said ‘index’.
        so i think the issue is solved.
        Dibankar please guide me if i should keep ‘categories’ for search engine crawling or NOT.
        Thanks a LOT for your help

        1. If you follow step-4 (1.1 – Replace first with this code), it will change the whole website (meta name=’robots’), I don’t anyhow, why category page marked as ‘noindex’, Please recheck source page, I hope it already solved, if not please share website. Thank you, Parth

  2. and ‘categories’ are still marked noindex because i have set them to ‘no’ in the seo section. So the default setting for categories remains ‘no’. May be this is the reason for any of my categories page to be set to ‘noindex’.

  3. Hey Dipankar,
    I discovered anew issue in my wordpress blog.
    The coverage report says “88” pages “excluded”

    Details

    Excluded Excluded by ‘noindex’ tag
    39

    Excluded Crawled – currently not indexed
    16

    Excluded Page with redirect
    15

    Excluded Discovered – currently not indexed
    9

    Excluded Alternate page with proper canonical tag
    9

    1. Hi,
      I read that your website facing SEO problems, some days before you can solve ‘noindex’ tag issue problem, now this time you will wait for a week, google SEO bot returns you website and analytic, research previous error data solve or not, also you send me your website link, Thank you.

      1. Dipankar Baidya I am facing the same issue my website is showing NO index tag and i have everything as you said can you help me in this matter

  4. Hi Dipankar,
    Please check the shayribaz.in and let me know the solutions for the issues i am facing. Also please *remove* all the site links from this msg before publishing it for obvious reasons.

    Below is the google search console’s coverage report for today. I am confused if i should put ‘yes’ for tags and categories in seo settings or is there any other prblem. please check

    Excluded Excluded by ‘noindex’ tag
    N/A
    60
    Excluded Crawled – currently not indexed
    N/A
    24
    Excluded Alternate page with proper canonical tag
    N/A
    17
    Excluded Page with redirect
    N/A
    16
    Excluded Discovered – currently not indexed
    N/A
    10

    this page is valid: /tapish-shayri/
    while this is not : /category/tapish-shayri/

    and many similar problems. May be this is beause i have put a “NO” for categies and tags in the seo settings.
    what should i do?

  5. Hi. Thanks for your article, I was very frustrated looking for something to help me understand what was happening in my website. My web is new and for a month google search was indexing my website, but then it stop and error message start to appear when I tried to index “noindex tag in robots file was found”. I’m using yoast SEO since the beginning and this wasn’t a problem at all, but I believe it might be related to hosting update to Php 7.4, is the only thing that I changed a week ago, 2 days after the issue started. For now I was able to edit the file, make the changes and upload, also verified that the correct file is up, but so far google search console hasn’t recognized my URL but I believe it might be a matter of time, because I think the don’t do these scans daily?. I’m positive! thanks a lot again

Leave a Reply

Your email address will not be published. Required fields are marked *