Skip to content

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

Open
@PaulRBerg

Description

@PaulRBerg

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>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions