Allow site configuration to not index tag pages #10835
Description
Have you read the Contributing Guidelines on issues?
- I have 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.
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.