Skip to contentSkip to main navigation Skip to footer

Add Custom Noindex Meta

Squirrly SEO Add Custom Noindex Meta screen on a laptop

Squirrly SEO writes a robots meta on every page, index,follow by default. You can switch one page to noindex or nofollow in its SEO Snippet, a whole post type in SEO Automation, or any page with the sq_noindex filter.

Before you start

The robots meta needs Add Robots Meta on in Squirrly > Technical SEO > SEO Metas. It is on by default and shows in SEO Expert mode. SEO Metas covers the switch.

When Discourage search engines from indexing this site is ticked in Settings > Reading, Squirrly writes no index or noindex value at all.

Noindex one page

  1. Go to Squirrly > Optimize > Bulk SEO and pick the post type, or open the page in the editor and scroll to the SEO Snippet box.
  2. Click the Visibility dot of the page, then Edit Visibility.
  3. Switch Let Google Index This Page off. Switch Send Authority to this page off too if you also want nofollow.
  4. Switch Show it in Sitemap.xml off, so the sitemap doesn’t list a page you hide.
  5. Click Save.

The page source then shows:

<meta name="robots" content="noindex,follow">
<meta name="googlebot" content="noindex,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1">
<meta name="bingbot" content="noindex,follow,max-snippet:-1,max-image-preview:large,max-video-preview:-1">

The Visible on Google task in Bulk SEO turns red for that page, so you can find every noindex page with Filter by Red Element > Visibility.

Example on the demo store

The Visibility tab holds the switches. With Let Google Index This Page on, the robots meta in the page source says index,follow; turn it off and it says noindex.

Squirrly SEO snippet Visibility tab with Let Google Index This Page, Send Authority to this page and Show it in Sitemap.xml
The Visibility tab of a demo post, all three switches on.
Squirrly SEO title, robots, description, keywords and canonical tags in the page source
The robots, googlebot and bingbot metas in the page source, lines 2 to 4 (formatted for reading).

Noindex a whole post type

Go to Squirrly > Optimize > Automation, open the post type and switch off Let Google Index it, then save. The snippet of each page of that type then says, for posts, “This Post Type (post) has Noindex set in Automation.” SEO Automation explains the visibility switches.

Change the robots meta with the sq_noindex filter

Add the code to your child theme’s functions.php or a code snippets plugin. Change 45 to your page ID.

add_filter( 'sq_noindex', 'my_squirrly_noindex', 12 );
function my_squirrly_noindex( $robots ) {
    if ( get_queried_object_id() === 45 ) {
        return array( 'noindex', 'nofollow' );
    }
    return $robots;
}

Before priority 99 the filter gets an array of values, for example array( 'index', 'follow' ). Squirrly joins them into the robots, googlebot and bingbot metas at priority 99. Priority 12 runs after Squirrly’s own rules at 10 and 11. Return $robots unchanged for the other pages.

Frequently asked questions

What is the difference between noindex and nofollow?

Noindex keeps the page out of search results, and nofollow tells search engines not to follow its links.

Do I need to remove a noindex page from the sitemap too?

Yes, the snippet’s hint says “Don’t show in Sitemap XML a page set as Noindex.”

Why don’t the Visibility switches change anything?

Check that Add Robots Meta is on in SEO Metas, then clear the page cache.

Was This Article Helpful?

Before you leave

Future of AEO GEO and AI Search!

Free Now. Free Forever.

It’s time to stop orbiting SaaS.

Be the Meteor.

10 Elite Tools. 1 Stack.