[18.0][ADD] website_exclude_sitemap - #1177
Open
edescalona wants to merge 1 commit into
Open
Conversation
edescalona
force-pushed
the
18.0-add-website_exclude_sitemap
branch
from
April 20, 2026 15:29
6613e81 to
4fb3741
Compare
edescalona
marked this pull request as ready for review
April 20, 2026 15:37
|
There hasn't been any activity on this pull request in the past 4 months, so it has been marked as stale and it will be closed automatically if no further activity occurs in the next 30 days. |
rrebollo
reviewed
Sep 2, 2026
| # Copyright 2026 Binhex <https://www.binhex.cloud> | ||
| # License AGPL-3.0 or later (https://www.gnu.org/licenses/agpl.html). | ||
|
|
||
| from odoo import _, fields, models |
There was a problem hiding this comment.
Suggested change
| from odoo import _, fields, models | |
| from odoo import fields, models |
| "type": "ir.actions.client", | ||
| "tag": "display_notification", | ||
| "params": { | ||
| "title": _("Sitemap reloaded"), |
There was a problem hiding this comment.
Suggested change
| "title": _("Sitemap reloaded"), | |
| "title": self.env._("Sitemap reloaded"), |
| "tag": "display_notification", | ||
| "params": { | ||
| "title": _("Sitemap reloaded"), | ||
| "message": _( |
There was a problem hiding this comment.
Suggested change
| "message": _( | |
| "message": self.env._( |
edescalona
force-pushed
the
18.0-add-website_exclude_sitemap
branch
from
September 10, 2026 20:18
4fb3741 to
f6ca34c
Compare
Let website administrators exclude public URLs from /sitemap.xml through a per-website list of paths or glob patterns, configured in Website > Configuration > Settings. Only sitemap generation is filtered: pages stay published and directly accessible. The sitemap cache is cleared when the exclusions or the website pages change, and a Reload Sitemap button clears it manually.
edescalona
force-pushed
the
18.0-add-website_exclude_sitemap
branch
from
September 10, 2026 20:24
f6ca34c to
24c8346
Compare
Author
|
Hi @rrebollo , thanks for the review; the suggestions have been applied. @pedrobaeza |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
@BinhexTeam
T21540
Context
Odoo includes every public website URL in the generated sitemap. Some of those URLs are useful for direct navigation but add little or no SEO value when exposed in
/sitemap.xml(/livechat, feeds, apply forms, user profiles...). This module keeps the sitemap focused on strategic public pages while leaving normal website access untouched.What it does
sitemap_excluded_pathstext field, editable from Website > Configuration > Settings > Sitemap Exclusions.website._enumerate_pages()to drop the entries whose path matches one of the configured patterns.website.pagerecords are created or deleted, and when theirurl,website_published,website_indexed,date_publishorwebsite_idchanges.The module only affects sitemap generation: it does not unpublish pages, change access rights, or block direct access to the excluded URLs.
Pattern syntax
Values are separated by line breaks, commas or semicolons; lines starting with
#are comments./livechat/livechat/livechat/room/customers//customers,/customers/acme,/customers/acme/2024/customers-list/blog/*/feed/blog/news/feed/blog/a/b/feed,/blog/news/solutions*/solutions,/solutions-cloud/solutions/cloud/jobs/**/jobs,/jobs/apply/1,/jobs/a/b/c/jobs-list*matches inside a single path segment and never crosses a/.**crosses/, matching any number of segments./or/**is a prefix: it excludes that path and everything below it.The default value only covers paths present in any Odoo website (
/customers/,/livechat,/blog/*/feed,/jobs/apply/,/profile/); deployment-specific paths are meant to be added by the administrator.Implementation notes
tools.ormcachekeyed on the raw exclusions text, so they are compiled once per configuration instead of once per sitemap entry.write()onwebsiteclears the registry cache whensitemap_excluded_pathschanges, so the compiled patterns are invalidated too./sitemap-<website_id>-%binary attachments.website_id(shared across websites) invalidate the sitemap cache of every website.