Skip to content

Improve SEO by having the 5.x docs take priority #428

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

Open
2 of 4 tasks
PaulRBerg opened this issue Apr 1, 2025 · 2 comments
Open
2 of 4 tasks

Improve SEO by having the 5.x docs take priority #428

PaulRBerg opened this issue Apr 1, 2025 · 2 comments

Comments

@PaulRBerg
Copy link

PaulRBerg commented Apr 1, 2025

Problem

User searches for "OpenZeppelin AccessControl" on Google, and they open this URL:

https://docs.openzeppelin.com/contracts/2.x/access-control

Which contains the documentation for the 2.x contracts, which are not the most up-to-date. As of posting this issue, the latest version is 5.x.

There's no warning or anything in the docs.

Toggle to see screenshot

Image

Solution

  • Add a warning at the top of every 2.x/3.x/4.x docs page that the latest version is 5.x and users should switch to that.
  • Make the warning float, so it is still visible if the user scrolls down.
  • Provide a sitemap with different <sitemod> timestamps, e.g. below.
  • (OPTIONAL) Stop indexing the old docs.

Example Sitemap

The sitemap tells Google: "Hey, this is the up-to-date version—crawl and rank this". This alone won't de-index the old pages, but it increases the chances that the new ones take precedence.

<url>
  <loc>https://docs.openzeppelin.com/contracts/5.x</loc>
  <lastmod>2025-03-01</lastmod>
</url>
<url>
  <loc>https://docs.openzeppelin.com/contracts/4.x</loc>
  <lastmod>2024-06-01</lastmod>
</url>
@PaulRBerg
Copy link
Author

cc @ernestognw @ericglau

@frangio
Copy link
Contributor

frangio commented Apr 7, 2025

Provide a sitemap with different <lastmod> timestamps

This will be more more difficult. Antora issue about it: https://gitlab.com/antora/antora/-/issues/661

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants