facebook / docusaurus

Easy to maintain open source documentation websites.
https://docusaurus.io
MIT License
54.07k stars 8.1k forks source link

Unable to remove self referencing hreflang tags #10249

Closed GeorgeLoukovitis closed 1 week ago

GeorgeLoukovitis commented 1 week ago

Have you read the Contributing Guidelines on issues?

Prerequisites

Description

Self referencing hreflang tags are considered to be bad practice in SEO. The docusaurus docs state that:

Docusaurus adds some metadata out-of-the-box. For example, if you have configured i18n, you will get a hreflang alternate link.

Screenshot 2024-06-25 at 5 37 35 PM

But those tags do not get removed when the i18n configuration is deleted from the docusaurus config

Reproducible demo

No response

Steps to reproduce

  1. Run npx create-docusaurus@latest my-website classic
  2. Delete the i18n configuration from docusaurus.config.js
  3. Run npm start to serve the docusaurus website
  4. Inspect the HTML code from the developer tools to find the hreflang tag

Expected behavior

The hreflang tag should have been removed

Actual behavior

The hreflang tag has not been removed

Your environment

Self-service

Josh-Cena commented 1 week ago

This has been a recurring topic. Where do you find self-referencing hreflang being an anti-pattern? See https://github.com/facebook/docusaurus/issues/6011 for a previous discussion. If you want to provide information, backed by trustable sources, please reply in https://github.com/facebook/docusaurus/issues/6075 instead.