How do I use the XML Sitemap Module for onsite Drupal SEO?

https://www.drupal.org/project/xmlsitemap

About the XML Sitemap module

The XML Sitemap module creates an XML Sitemap of your content that you can submit to the search engines. An XML sitemap is a specially formatted summary of each piece of content on your website. You can read more at http://www.sitemaps.org/.

Having an XML sitemap helps your SEO by giving Google a list of the pages that you wish them to crawl. While Google can crawl your site without an XML sitemap, bigger and more complex sites confuse the crawler so it could potentially miss pages and even whole sections. If you don’t do this, you will have to manually submit every single page of your site to Google which is ridiculously time-consuming.

Install and Enable the XML Sitemap Module

  1. Install the XML Sitemap module on your server.
  2. Go to the Extend page: Click Manage > Extend (Coffee: “extend”) or visit http://yourDrupal8site.dev/admin/modules. 3. Select the checkbox next to “XML sitemap”, “XML sitemap custom”, and “XML sitemap engines” and click the Install button at the bottom of the page.

If necessary, give yourself permissions to use the XML Sitemap module.

  1. Click Manage > People > Permissions (Coffee: “perm”) 
  2. Select the appropriate checkbox for “Administer XML sitemap settings”.
  3. Select the appropriate checkbox for “User > View user information” if you wish for your XML sitemap to include user information.
  4. Click the Save permissions button at the bottom of the page.

The XML sitemap is automatically updated when Cron runs. That makes it unnecessary to rebuild your sitemap again unless you run into problems.

Set up Cron

Cron is a system built into your server that runs maintenance tasks on a regular basis. The Drupal cron tasks maintain and clean up your Drupal site. It does things like check for updates, indexes content, and rebuilds XML sitemaps.

  1. Click Manage > Configuration > System > Cron (Coffee: “cron”) or visit http://yourDrupal8site.dev/admin/config/system/cron in your browser.
  2. Set Run cron every to “3 hours”. You can set this to be more frequent or less frequent depending on how often you update your website.
  3. Click the Save configuration button at the bottom of the page.

Now your XML sitemap will stay up to date with your site content.

To view your XML sitemap, visit http://yourDrupal8site.dev/sitemap.xml. In the next few sections, we’ll submit your newly created XML sitemap to Google and Bing.