Removing calls to noindex() and wp_no_robots()

In the general-template.php file, I have functions (see below – "noindex" "no robots") that are not allowing Google bots to index the website. I am trying to find the code where these functions are used. I looked into many files but I can't seem to find which file is using this code or where these functions are called from.

I need to remove these functions from where they are used in WordPress code. I have tried to remove the code from the general-template.php file but then it started to give me an error. So, I am pretty sure that I can't just delete them here; I need to remove the functions where they are used in other files of the WordPress code.

Any idea how I can do this?

/**
* Display a noindexmeta tag if required by the blog configuration.
*
* If a blog is marked as not being public then the noindexmeta tag will be
* output to tell web robots not to index the page content. Add this to the wp_head action.
* Typical usage is as a wp_head callback. add_action( 'wp_head', 'noindex' );
*
* @see wp_no_robots
*
* @since 2.1.0
*/
function noindex() {
    // If the blog is not public, tell robots to go away.
    if ( '0' == get_option('blog_public') )
        wp_no_robots();
}
/**
* Display a noindexmeta tag.
*

Topic noindex templates Wordpress

Category Web


Why you are changing the code for these thing which are able done via dashboard.?

WordPress comes with a built-in feature that allows you to instruct search engines not to index your site. All you need to do is visit Settings » Reading and check the box next to Search Engine Visibility option.

When this box is checked, WordPress adds this line to your website’s header:

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

WordPress also modifies your site’s robots.txt file and add these lines to it:

User-agent: *
Disallow: /

These lines ask robots (web crawlers) not to index your pages. However, it is totally up to search engines to accept this request or ignore it. Even though most search engines respect this, some page or random image from your site may get indexed.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.