Interface SitemapPageFilter


  • @ConsumerType
    public interface SitemapPageFilter
    This interface is filter that can be implemented by consumers to exclude certain pages from a sitemap.

    shouldInclude(Page) can be used to exclude individual Pages from all sitemaps and shouldFollow(Page) to stop the traversal at a given Page. However, both methods only complement the default behaviour. Pages that are unpublished, protected, redirect or marked not to be indexed by search engines, will remain excluded from all sitemaps.

    If there are multiple SitemapPageFilter services registered, the one with the highest service ranking will be used.

    • Method Detail

      • shouldInclude

        boolean shouldInclude​(Page page)
        Implementations may return false to exclude the given Page from all sitemaps.
        Parameters:
        page - the given Page to check
        Returns:
        false to exclude the Page from all sitemaps, true otherwise
      • shouldFollow

        boolean shouldFollow​(Page page)
        Implementations may return false to exclude the given subtree from all sitemaps.
        Parameters:
        page - the given subtree's root Page to check
        Returns:
        false to exclude the subtree from all sitemaps, true otherwise