Skip to main content
Image
blog-banner-opensenselabs%20%281%29.jpg

Setting Up Sitemap in Drupal 8

article publisher

Bikash

Drupal

Sitemaps can be regarded as a blueprint for a website. It helps users to understand how different pages on a site are linked together, their hierarchy and the sub-pages. They can either be really simple or be extremely complicated.  

Modules such as XML Sitemap and Simple XML Sitemap generate sitemaps that are accessible by crawlers and bots. In my previous article Drupal Module User Guide: SimpleXML Sitemap, we discussed how to install, configure and use simple XML sitemap module in your Drupal Website. In this article, we will set up the XML sitemap module. 

Although sitemaps are important for SEO, understanding them can be a tough task and humans would find it inconvenient to follow up as they are written in Extensible Markup Language or XML. Therefore we use modules to generate sitemaps that are easy to understand. In short, this module provides a summary of all the contents of a site. 

An example of Sitemap
An example of Sitemap

Setting Up The Sitemap Module

Install the module from Drupal.org. 

Configure this module to serve our purpose. The Settings tab of this module can be accessed by navigating to

Configuration >Search & Metadata >Sitemap

  • Page Title:

    The first field is the page title or the name of the node. Let's name it as 'sitemap'.
     
  • Sitemap Message:

    Anything written inside the Sitemap message field gets displayed at the very top of the page. The text format can be switched between Basic, Restricted and Full HTML.Anything written in the Sitemap message field will be displayed at the top of the site map
  • Sitemap Content:

    In this section, the contents that should appear and the order in which they appear can be controlled by simply dragging the contents to the desired location.
    Sitemap Content Section
    Content Section
  • Sitemap settings:

    This section is divided into two subsections viz., RSS settings and CSS settings.
     
    • RSS settings:
      Customise the appearance of RSS links on either side and also the subclasses of vocabularies to be included.
       
    • CSS settings:
      This comprises of only a checkbox which controls if the CSS files will be loaded or not.
      Sitemap Settings Section
      Settings Section
  • Menu Settings: 

    Some menu settings are disabled by the administrator if they are not to be used or are useless. However, these settings can either be displayed or hidden in sitemaps using this setting.
    • Taxonomy setting
      This setting is used to customise vocabulary settings such as description display and node count display,
       
    • Vocabulary Depth:
      The inclusion or exclusion of sub-classes can be specified in the vocabulary depth field by inserting one of the following values.
      -1: To include all terms
      0: To exclude all terms
      1: To include only top level terms
       
    • Term Count Threshold:
      The term count threshold setting includes terms only when the node count of the particular term crosses the set threshold. Setting the value to -1 disables this threshold.
      The Menu & Taxonomy Settings Section
      The Menu & Taxonomy Settings Section
  • Hit Save Configuration to save all the changes made.

Sitemaps provide a basic idea of what the site contains to the viewer and although there isn’t any SEO benefit, it should make navigating through the contents of a site faster.
And also, visitors can get an idea of the contents of the site without aimlessly surfing around.

This is everything one needs to know to get up to speed on the Sitemap module. Let me know in the comments below how you found the article. 

Subscribe

Ready to start your digital transformation journey with us?

Related Blogs

SDC: Integrating Storybook & Single Directory Component

Integrating SDC With Storybook OpenSense Labs

Today, we will talk about about Drupal Single Directory Components or SDC and Storybook. Single Directory Components in Drupal allows you…

RFP: How To Create An RFP For Open Source Solutions?

RFP OpenSense Labs

A good Request for Proposals (RFP) or Call for Proposals (CFP) clearly states the goals and expectations of your project and sets the…

Drupal 7 End Of Life: Top Reasons You Should Migrate To Drupal 10

Drupal 7 End Of Life Cover Image OpenSense Labs

Drupal 10 was released in December 2022 and ever since, the community has been pushing its users to do Drupal 7 to 10 migration. As per…