Prevent Search Engine Indexing

How to prevent Google from indexing one of the pages on my website?

Hi there,

You may use the Yoast SEO plugin for this.

First thing you need to do is install and activate the Yoast SEO plugin.

Next, you need to edit the post or page that you want to hide from search engines. Scroll down to the Yoast SEO meta box below the post editor and click on the advanced settings button.

Hiding a WordPress post or page from Google using Yoast SEO

The advanced settings section allows you to add meta tag robots to your blog posts or pages. Using the robots meta tag, you can tell search engines not to index or follow a page.

First you need to select ‘noindex’ from the drop down menu next to ‘Meta robots index’ option. After that, click on ‘nofollow’ next to ‘Meta robots follow’ option.

You can now save/publish your post or page.

Yoast SEO will now add this line of code to your post or page:

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

This line simply tells search engines not to follow or index this page.

Hope this helps.

Is there any other way to add the code without the Yoast plugin?

Hi there,

You may add the code through the functions.php file of the child theme like this:

add_action('wp_head', 'add_no_index');

function add_no_index() {
    if(is_page(XXXX)) {
?>
    <meta name="robots" content="noindex,nofollow"/>
<?php
    }
}

Please change XXXX in the code to the page ID of the page that you do not want to be indexed.

Kindly check this link on how to find the page ID:

Hope this helps.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.