Categories
Uncategorized

Configuring Sitemap in Drupal

A sitemap is instructions to a search engine telling it where to crawl your website. This will ensure that search engines will find all the relevant content of your site an display it in search results. Check out Google’s guide of how Google Search works to learn exactly how crawling works.

If you create a page or piece of content that isn’t linked anywhere, it’s unlikely that a search engine will find it. When you link to a page on another page of your website, search engines can find it.

Sitemap basics

For the central distribution Druapl here of Oregon State University, you can find your sitemap at sitename.oregonstate.edu/sitemap.xml.

This will show every piece of content included in your sitemap.

To configure your sitemap, first log into your website. You need to be an architect to configure it.

Go to Configuration > Search and Metadata > XML Sitemap

Drupal 7 sitemap configuration

The sitemap includes little by default. However, if you’ve linked to your relevant content, then don’t panic, search engines have probably found it.

There are 4 sections to configure. In each of these sections, you’ll see a list of the things you can include or exclude from your sitemap. It will also tell you which content has been indexed.

To

Frontpage

The configuration includes the front page by default and sets it at the highest priority. No need to make changes here! We’re good to go.

Menu Link

This is any link created by a menu in your website. You can include the menu items that are being used in your website, but they are probably already indexed. Again, remember that search engines can find links that are on your website that are linked from other content. Since menus usually display on multiple pages, search engines can find them easily.

How to add a menu to the sitemap

  • You need to go to Structure > Menus
  • Click Edit menu link to the right of the menu you want to include
  • Expand the XML sitemap section
  • Change the Inclusion from Excluded to Included
  • Click Save

Be sure to never include the Management menu. That is the administrative menu for Drupal.

Content

By default, the configuration adds no content to the sitemap. However, don’t panic. If you’re been linking to your important content, the search engines can find it.

Recommend to include:

  • Book page
  • Basic page
  • Webforms
  • any default content type that you use
  • any custom content type that you have created
    • Keep in mind that this will include the node view of your content type. If you haven’t styled it and only expose certain fields in a view, then you don’t want include your content type.

How to add content to your sitemap

  1. Click on the content type name you’d like to add
    • This takes you to the content type editing screen
  2. Click on the XML sitemap tab at the bottom of the page.
  3. Change the Inclusion from Excluded to Included
  4. Click Save content type
  5. This will then take you back to the sitemap configuration page

Repeat these steps for any content type you want to include.

User

This is anyone you have added to your website. Oftentimes, these are the people in your department or unit to display in the directory. But some people only edit the website and aren’t in your department or unit.

You can exclude or include any individual by editing their profile. First look at the Account section of their profile, and then find the section on that configuration page for XML Sitemap.

screenshot of Drupal admin interface with the XML sitemap section highlighted. It is after the URL redirect section.

Drupal 9 sitemap configuration

For Drupal 9, we have included the default content types (profile, basic page, and story) and groups.

If you create any custom content type, add it to the sitemap when you create it.

If you use taxonomy term pages in your website and want them to show up in search results, you can add them. You can add them under Sitemap Entities. This is also where you can add other entities of your site, as you see fit.

Pages produced by a view

Pages produced by a view are unique and need to be manually added to the sitemap under Custom links in the sitemap configuration.

Submit the sitemap

The sitemap module will submit your sitemap on your behalf automatically after initial configuration.

Click on the Search Engines tab in the XML sitemap menu.

Here are the configurations that you want to set:

  1. Submit to both Bing and Google
  2. Do not submit more often than every 1 week
  3. Leave the box checked next to “Only submit if the sitemap has been updated since the last submission”

Click Save Configuration.

If you have Google Search Console turned on, you can double check that it’s being submitted to Google via the Sitemaps report. Learn how to manage your sitemaps in Google Search Console.

Print Friendly, PDF & Email