-
-
Notifications
You must be signed in to change notification settings - Fork 8.9k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added additional head tag to noindex, follow the search page #3233
Added additional head tag to noindex, follow the search page #3233
Conversation
Deploy preview for docusaurus-2 ready! Built with commit 0266576 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not a good idea to apply globally
you can do this by using @docusaurus/Head (Helmet wrapper) directly on the search page instead
name: 'robots', | ||
content: 'noindex, follow', | ||
}, | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unfortunately this adds noindex nofollow to ALL the docusaurus site, not just search.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How do we do it just to search? That's what we want.
And I don't understand why this isn't a good idea to do for all search results pages using Docusaurus, as that's long been the recommendation of all major search engines.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because this change does not prevent indexing the search page, it prevents indexing ALL the documentation website (ie the website would disappear from Google, very bad!).
It has never been advised by search engines to not index anything at all.
How to apply this only to a single page? Not through the config, but on the page itself you can use this declarative component:
https://v2.docusaurus.io/docs/docusaurus-core#head
Read the doc of React helmet to understand how it works.
I can't provide much more help because helping you contributing this change would take me more time than doing it myself :) If you want me to do it tell me, otherwise you can edit your PR
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The PR is closed already? |
Motivation
Ensures that search pages can't get indexed by search engines, as this is considered bad UX when coming from a search engine such as Google
Have you read the Contributing Guidelines on pull requests?
Yes
Test Plan
http://localhost:3000/search
<meta name="robots" content="noindex, follow" />
tag in the<head>
section.Related PRs
(If this PR adds or changes functionality, please take some time to update the docs at https://github.com/facebook/docusaurus, and link to your PR here.)