ILL needs a new payment form. As part of the spec for this form, the page should not be discoverable in search engines, however, when thinking this through, there are probably three things we need:
The ability to exclude pages from search results.
The ability to exclude pages from site search in the Wagtail site.
The ability to exclude pages from the Google sitemap.xml.
We can create Boolean fields in the Page model for each of the above so that their behavior is controlled separately. We can exclude pages from search engine indexing by displaying the <meta name="robots" content="noindex" /> in the templates if the related exclude field is set. We can exclude pages from Wagtail site search by filtering the QuerySet in results/views.py using Django's exclude filter. Pages can be suppressed from the sitemap by defining a get_sitemap_urls on the Page model in a fashion similar to this.
ILL needs a new payment form. As part of the spec for this form, the page should not be discoverable in search engines, however, when thinking this through, there are probably three things we need:
We can create
Boolean
fields in thePage
model for each of the above so that their behavior is controlled separately. We can exclude pages from search engine indexing by displaying the<meta name="robots" content="noindex" />
in the templates if the related exclude field is set. We can exclude pages from Wagtail site search by filtering theQuerySet
inresults/views.py
using Django's exclude filter. Pages can be suppressed from the sitemap by defining aget_sitemap_urls
on the Page model in a fashion similar to this.