Interface SeoTags


  • @ConsumerType
    public interface SeoTags
    This model interface gives access to SEO specific information of a page.

    It can be adapted from any Page's content that is a of sling:resourceType wcm/foundation/components/basicpage/v1/basicpage.

    Usage:

    page.getContentResource().adaptTo(SeoTags.class)
    • Method Detail

      • getCanonicalUrl

        @Nullable
        @Nullable String getCanonicalUrl()
        Returns the canonical url of the current Resource.

        This uses the SitemapLinkExternalizer implementation to ensure the same canonical url as it is used in Sitemap(s) is returned. The format of the url is complete, meaning it contains authority, path and extension.

        This may return null when the externalization fails.

        Returns:
        The canonical, absolute url of the current page.
      • getAlternateLanguages

        @NotNull
        @NotNull Map<Locale,​String> getAlternateLanguages()
        Returns a Map of alternate language urls of the current Resource.

        An alternate language link exists for each language copy of the Page, when the Page is included in a Sitemap. It uses the SitemapLinkExternalizer to ensure the same canonical urls as in Sitemap(s) are returned. The format of the url is complete, meaning it contains authority, path and extension.

        Returns:
        The canonical, absolute urls of all alternate language versions of the current page.
      • getRobotsTags

        @NotNull
        @NotNull List<String> getRobotsTags()
        Returns a List of robots tags to be provided to search engine crawlers.

        The collection is curated and may only return tags that are allowed to appear together.

        Returns:
        the curated List of robots tags