Skip to content

Allow site configuration to not index tag pages #10835

Open
@undergroundwires

Description

Have you read the Contributing Guidelines on issues?

Description

Solution

Proposed API:

User experience, add new flag for DocusaurusConfig in docusaurus.config file such as deindexTags: true.

Proposed changes:

Behavior Changes
Tag URLs <a> elements will have rel="noindex nofollow" attributes on tag lists pages. Update Tag to do he check from siteConfig.
Tag list page (root component of the tags list page) will have <meta name="robots" content="noindex, nofollow">. Update DocTagsListPage and BlogTagsListPage to add the Head with noindex meta.
Tag page (root component of the "containing tag X" page) <meta name="robots" content="noindex, nofollow">. Update DocTagDocListPage and BlogTagsPostsPage to add the Head with noindex meta.
Sitemap ignores /tags** Theme sets sitemap.ignorePatterns:[${tagsBasePath}**].

Motivation

Why

Tag pages are thin/low quality, creating duplicated content.
This leads to search engines scoring the website lower, or indexing tag pages before the specific pages.

Google says 1:

Block crawling of duplicate content on your site, or unimportant resources (such as small, frequently used graphics such as icons or logos) that might overload your server with requests. Don't use robots.txt as a mechanism to prevent indexing; use the noindex tag or login requirements for that

I have solved this through wrapping/swizzling list pages, tag components and and custom sitemap.ignorePatterns rule in the config file, but it's a lot of workaround and a best-practice like this would be appreciated if it came as default.

Background

This has lead to me issues with all search engines for privacylearn.com to present open-source scripts pre-launch.

siteliner analysis:

Google indexing status:

Engines include Google, Yandex and Bing where thousands of my pages got de-indexed over time and tags pages took more priority than proper pages.

API design

No response

Have you tried building it?

No response

Self-service

  • I'd be willing to contribute this feature to Docusaurus myself.

Metadata

Assignees

No one assigned

    Labels

    featureThis is not a bug or issue with Docusausus, per se. It is a feature request for the future.status: needs triageThis issue has not been triaged by maintainers

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions