[18.0][ADD] website_exclude_sitemap - #1177
Conversation
6613e81 to
4fb3741
Compare
|
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. |
f6ca34c to
24c8346
Compare
|
Hi @rrebollo , thanks for the review; the suggestions have been applied. @pedrobaeza |
24c8346 to
249b83e
Compare
|
Hi @pedrobaeza , thanks for the review. That column only affects For example, with Furthermore, the standard core toggle works on a record-by-record basis, whereas here, a pattern like I’ve added a test ( Does that make sense to you, or do you see another way to handle this case? |
|
Well, on blogs you can also mark to not track, but OK if you consider the accelerator for the main path. The problem I see with this is the UI, as if you go to the blog page/category and mark to track or not, will contradict this supra configuration. |
|
@pedrobaeza I could add a note in the settings explaining that the list takes precedence over the per-record markup—and also affects the |
|
OK, just mention it in the ROADMAP.md file and let people to decide. |
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.
249b83e to
ad9964e
Compare
|
ready @pedrobaeza |
|
OK, a second review is needed. |
jelenapoblet
left a comment
There was a problem hiding this comment.
This module solves a problem we have been dealing with for a long time: customizing the sitemap without modifying Odoo’s standard files.
I wasn't even aware you where working on this, I was modifying the sitemap manually with the marketing team all the time.
LGTM
|
Ready @pedrobaeza Can we merge now? |
|
This PR has the |
|
/ocabot merge nobump |
|
This PR looks fantastic, let's merge it! |
|
@pedrobaeza The merge process could not be finalized, because command |
|
@OCA/pypi-support to reserve the name |
|
Name reserved |
|
/ocabot merge nobump |
|
This PR looks fantastic, let's merge it! |
|
Congratulations, your PR was merged at 56d401a. Thanks a lot for contributing to OCA. ❤️ |

@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.