Skip to content

Added noindex meta tag to untranslated docs pages#2473

Open
vidhiii1711 wants to merge 7 commits intodjango:mainfrom
vidhiii1711:fix-noindex-untranslated-docs
Open

Added noindex meta tag to untranslated docs pages#2473
vidhiii1711 wants to merge 7 commits intodjango:mainfrom
vidhiii1711:fix-noindex-untranslated-docs

Conversation

@vidhiii1711
Copy link
Copy Markdown

This PR adds a noindex meta tag to untranslated documentation pages,
ensuring they are excluded from search engine indexing without relying
on robots.txt.

This aligns with search engine best practices and keeps translated
documentation pages discoverable.

Fixes #877

Copy link
Copy Markdown
Member

@bmispelon bmispelon left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi,

Have you checked that this changes work on your local version? I don't understand where is_translated is defined.

We also need a two tests: one for a translated page to check the meta tag is not present, one for an untranslated page to check the meta tag is present.

Thanks!

<script src="{% static "js/mod/switch-dark-mode.js" %}"></script>
{% block head_extra %}{% endblock head_extra %}
{% block head_extra %}
{% if not is_translated %}
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Unless I've missed it, this variable is_translated is never defined anywhere, so this will not work.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi, thanks for the review!

I'll update the implementation to use the correct variable from the docs system and I'll also add the two tests you suggested.

I'll push the updates shortly. Thanks!

@bhavanasam
Copy link
Copy Markdown

bhavanasam commented Mar 15, 2026 via email

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

Successfully merging this pull request may close these issues.

Use noindex meta tag or header, not robots.txt, to block untranslated docs pages

3 participants