apache / apache/arrow

[Documentation][R] Update docs to ensure Google searches point to the latest ones

Open
#49,692 0 comments 0 reactions 0 assignees View on GitHub
Component: Documentation Type: enhancement
Dominant language
C++
Stars
17.1k
Forks
4.3k
Avg merge
3d 13h
Merged PRs (30d)
88

Description

### Describe the enhancement requested

Google searches for docs take users to older versions: https://bsky.app/profile/tanho.ca/post/3miwyhp63q22w

AI has the following recommendations, but I think that we might be able to add in custom html or make a PR to pkgdown if it doesn't work.

We should also make a PR to arrow site with the fixes for previously rendered docs

:robot: analysis below

-------------------------------------------------------------------------------------------------------------------

Three things combine:

1. No canonical tags on R docs — The Python/C++ docs (built with Sphinx) have
tags on every page, including old versions, pointing to the current URL. The R docs (built with pkgdown)
have none. So Google sees 24 copies of the same content and has to guess which is authoritative.
2. URL changed between v12 and v13 — The schema page was Schema.html (capital S) in v12, but became
schema.html (lowercase) from v13 onward. Google indexed the old URL, it still works on v12, and the
current docs return 404 for the capitalized version. Google has no reason to switch.
3. All 24 old versions are fully crawlable — No noindex, no canonical tags, no robots.txt restrictions.
The old versions collectively have more inbound links from years of Stack Overflow answers and blog
posts.

What could fix it

The most impactful approach would be:
- Add canonical tags pointing to the current (unversioned) URL on all pages
- Add noindex to old versioned docs so Google stops surfacing them

pkgdown doesn't natively support canonical tags, so this would likely need a post-build script that
injects them into the HTML after pkgdown generates the docs. The Python/C++ docs already solve this via
Sphinx's built-in canonical URL support.

### Component(s)

Documentation

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.