-
-
Notifications
You must be signed in to change notification settings - Fork 2.7k
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
Link canonical documentation to discourage search engines from linking old docs #12363
Comments
@jfrost-mo that's good to know, thanks a lot for detailing this. I'm all up for it, would you like to open a PR with that? |
jfrost-mo
changed the title
Link canonical documentation to discourage search engines from linking old docs.
Link canonical documentation to discourage search engines from linking old docs
May 24, 2024
nicoddemus
pushed a commit
that referenced
this issue
May 26, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
nicoddemus
pushed a commit
that referenced
this issue
May 30, 2024
This is used to set the <link rel="canonical" href="X"> tag that points to the canonical version of the webpage. Including this indicates to search engines which version to include in their indexes, and should prevent older versions showing up. Fixes #12363
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
What's the problem this feature will solve?
Currently when you search for a pytest feature on the web you often get linked to an old version of the documentation. This isn't ideal, as newer versions of the documentation have improvements, and its also rare that you are running the multi year old version that is often linked to.
Describe the solution you'd like
Fortunately this situation can be resolved by adding a
<link rel="canonical" href="url of page in stable version">
tag onto all of the documentation pages. This can be done with sphinx by specifying the html_baseurl in theconf.py
.This would cause search engines indexing older versions of the page, as well as versions on other domains, such as the readthedocs.io temporary URLs, to relate all of these pages in the index, and show the canonical one in search results. After a few months the old pages should disappear from search results, and only the stable version will be shown.
Alternative Solutions
According to the documentation, ReadTheDocs should already be adding this, however it doesn't seem to be present on any pages. According to a different part of the ReadTheDocs docs, you might need to enable this for custom domains:
It is worth checking if that is set first, before doing anything here.
The text was updated successfully, but these errors were encountered: