eCommerce Pager Guard
by Terrabit https://www.terrabit.ro , Dorin Hongu https://www.terrabit.roeCommerce Pager Guard

Makes the shop return 404 for listing pages that do not exist.
Odoo’s pager() helper clamps an out-of-range page number to the last real page rather than refusing it. /shop/page/999999 therefore answers 200 with the content of the last page — and a crawler reads that as confirmation that the page exists, follows the pattern upwards and never stops.
On a production site this produced 2.386 requests per day against a single /shop/category/…/page/3467514 URL, each one paying for a full product search and QWeb render before serving duplicate content.
This module compares the requested page against the pager’s own page_count and raises NotFound when it is higher. /shop itself and the last real page are unaffected, so search engines get a clean signal that the URL space is finite.
Deliberately no hardcoded page ceiling: a real catalogue was measured at 2.578 shop pages, so even a limit that looks generous would refuse most of the listing. The page count is only known once the products are counted, which is why the check runs after super(). That still avoids the expensive part — request.render is lazy in Odoo, so raising there means the QWeb template is never rendered.
Important
This is an alpha version, the data model and design can change at any time without warning. Only for development or testing purpose, do not use in production. More details on development status
Table of contents
History
19.0.1.0.0 (2026-07-30)
- Initial release. Shop listing pages beyond the last real one now return 404 instead of being silently clamped to the last page by portal.controllers.portal.pager, which made every /shop/page/N answer 200 with duplicate content and left crawlers walking the page number upwards without end.
Bug Tracker
Bugs are tracked on Terrabit Issues. In case of trouble, please check there if your issue has already been reported.
Do not contact contributors directly about support or help with technical issues.
Credits
Authors
- Terrabit
- Dorin Hongu
Maintainers
Current maintainer:

This module is part of the dhongu/deltatech project on GitHub.
You are welcome to contribute.
| Availability |
Odoo Online
Odoo.sh
On Premise
|
| Odoo Apps Dependencies |
•
eCommerce (website_sale)
• Website (website) • Discuss (mail) • Invoicing (account) |
| Lines of code | 21 |
| Technical Name |
deltatech_website_pager_guard |
| License | OPL-1 |
| Website | https://www.terrabit.ro |
Odoo Proprietary License v1.0 This software and associated files (the "Software") may only be used (executed, modified, executed after modifications) if you have purchased a valid license from the authors, typically via Odoo Apps, or if you have received a written agreement from the authors of the Software (see the COPYRIGHT file). You may develop Odoo modules that use the Software as a library (typically by depending on it, importing it and using its resources), but without copying any source code or material from the Software. You may distribute those modules under the license of your choice, provided that this license is compatible with the terms of the Odoo Proprietary License (For example: LGPL, MIT, or proprietary licenses similar to this one). It is forbidden to publish, distribute, sublicense, or sell copies of the Software or modified copies of the Software. The above copyright notice and this permission notice must be included in all copies or substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
Please log in to comment on this module