Skip to content
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

feat(http): Add X-Robots-Tag header #37079

Merged
merged 20 commits into from
Dec 11, 2024
Merged

feat(http): Add X-Robots-Tag header #37079

merged 20 commits into from
Dec 11, 2024

Conversation

bsmth
Copy link
Member

@bsmth bsmth commented Dec 3, 2024

Description

This PR adds the X-Robots-Tag header page.

Omitting historical rules no longer used by Google, at least

  • noarchive
  • nocache
  • nositelinkssearchbox

See https://developers.google.com/search/docs/crawling-indexing/robots-meta-tag#directives

Motivation

We're missing docs about it, and it's a widely used header for controlling indexing & search presentation.

Related issues and pull requests

@bsmth bsmth requested review from a team as code owners December 3, 2024 18:00
@bsmth bsmth requested review from hamishwillee and estelle and removed request for a team December 3, 2024 18:00
@github-actions github-actions bot added Content:HTML Hypertext Markup Language docs Content:HTTP HTTP docs size/m [PR only] 51-500 LoC changed labels Dec 3, 2024
Copy link
Contributor

github-actions bot commented Dec 3, 2024

Preview URLs

External URLs (3)

URL: /en-US/docs/Web/HTTP/Headers/X-Robots-Tag
Title: X-Robots-Tag


URL: /en-US/docs/Glossary/Robots.txt
Title: Robots.txt

(comment last updated: 2024-12-11 12:58:12)

Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I know very little about HTTP headers and knew very little about robot directives, so I had many questions. I realize this is a reference and not a guide, so you may want to disregard some of my questions in favor of a guide.

it was really good, and I learned a lot. In addition to the above clarifications, just a few suggestions to make it less wordy for ease of reading.

files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved

## See also

- {{HTTPHeader("Forwarded")}}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

do we have a guide on setting HTTP headers that we can link to?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not yet, but that's a good idea. We could have a how-to page for this in the HTTP section, it might be good to talk about cases where you have a website but can't control headers (GitHub pages?)

files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I got a notification so re-reviewed. I just realized you didn't ask for another review yet, but already reviewed. as some of it may be helpful, sharing.

files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
@bsmth
Copy link
Member Author

bsmth commented Dec 6, 2024

I got a notification so re-reviewed. I just realized you didn't ask for another review yet, but already reviewed. as some of it may be helpful, sharing.

Super, thank you. I haven't incorporated all of the suggestions yet, so I can re-request when I think everything's in a good state 👍🏻

@bsmth bsmth requested a review from a team as a code owner December 6, 2024 10:08
@github-actions github-actions bot added the Content:Glossary Glossary entries label Dec 6, 2024
@bsmth bsmth requested a review from estelle December 6, 2024 10:25
@bsmth bsmth removed the request for review from hamishwillee December 6, 2024 10:41
Copy link
Member

@estelle estelle left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looking really, really good. Just think we may need a note on the all on one line example to indicate that the directives for all user agents goes first, and then exceptions for individual bots goes after if doing on one line (if that is accurate).

files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
Copy link
Member

@pepelsbey pepelsbey left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good! Thanks :)

Adding just one nitpick to the review. I’d suggest calling <meta> an element, not a tag. Unlike other sources do 🥲 It’s called an element in the spec, and we do it mostly consistently throughout the MDN.

Here’s how I usually explain the difference. The <p> element consists of opening <p> and closing </p> tags. Element is a language entity with its semantics, attributes, etc. Tag is a syntactic construction that makes all elements work.

files/en-us/web/html/element/meta/name/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/web/http/headers/x-robots-tag/index.md Outdated Show resolved Hide resolved
files/en-us/glossary/robots.txt/index.md Outdated Show resolved Hide resolved
@bsmth bsmth requested a review from estelle December 11, 2024 12:59
@bsmth
Copy link
Member Author

bsmth commented Dec 11, 2024

Thanks, both. I think this is ready to merge in case you want to have another quick look

@estelle estelle merged commit 24d8a34 into mdn:main Dec 11, 2024
8 checks passed
@bsmth bsmth deleted the http-x-robots-tag branch December 11, 2024 16:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:Glossary Glossary entries Content:HTML Hypertext Markup Language docs Content:HTTP HTTP docs size/m [PR only] 51-500 LoC changed
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants