diff --git a/src/meta/__tests__/buildTags.spec.tsx b/src/meta/__tests__/buildTags.spec.tsx index 49228967..8f046a05 100644 --- a/src/meta/__tests__/buildTags.spec.tsx +++ b/src/meta/__tests__/buildTags.spec.tsx @@ -945,8 +945,8 @@ it('correctly read noindex & nofollow false', () => { 'meta[content="noindex,nofollow"]', ); - expect(Array.from(indexfollow).length).toBe(0); - expect(Array.from(noindexnofollow).length).toBe(1); + expect(Array.from(indexfollow).length).toBe(1); + expect(Array.from(noindexnofollow).length).toBe(0); }); it('correctly read all robots props', () => { diff --git a/src/meta/buildTags.tsx b/src/meta/buildTags.tsx index c7a63a12..0c395a20 100644 --- a/src/meta/buildTags.tsx +++ b/src/meta/buildTags.tsx @@ -119,13 +119,14 @@ const buildTags = (config: BuildTagsParams) => { } const noindex = - config.noindex || - defaults.noindex || - config.dangerouslySetAllPagesToNoIndex; + config.noindex === undefined + ? defaults.noindex || config.dangerouslySetAllPagesToNoIndex + : config.noindex; + const nofollow = - config.nofollow || - defaults.nofollow || - config.dangerouslySetAllPagesToNoFollow; + config.nofollow === undefined + ? defaults.nofollow || config.dangerouslySetAllPagesToNoFollow + : config.nofollow; let robotsParams = ''; if (config.robotsProps) { diff --git a/src/meta/nextSEO.tsx b/src/meta/nextSEO.tsx index 28027864..006c403c 100644 --- a/src/meta/nextSEO.tsx +++ b/src/meta/nextSEO.tsx @@ -6,7 +6,7 @@ import { WithHead } from './withHead'; export const NextSeo = ({ title, themeColor, - noindex = false, + noindex, nofollow, robotsProps, description,