Simple XML Sitemap
Reference of the module on d.o.
Setup variants
Install using composer
composer require drupal/simple_sitemap
Enable the module either through drush or through UI.
After that navigate to the configuration page for the module (admin/config/search/simplesitemap)
On the “Settings” tab switch to the “Variants” child tab and create a variant
default | default_hreflang | Default
- the first segment is a URL segment - leave blank if you want your sitemap to live in the root of the site /sitemap.xml
and you are not planning to use any other sitemap variants.
If you are submitting your sitemap to third-party SEO services other than Google, identify their requirements to the path of sitemap.
Configure settings
Switch to the “Settings” tab and configure the settings.
Cron settings:
Allow regeneration of the sitemap on cron.
Reduce the interval to a daily - this is optimal amount of time but make sure it is in alignment with the volume of published content on your project. Some projects can have sitemap regenerated less often - some more often.
The bigger is your site the higher are the chances that the sitemap generation will not be finished during one cron run so have the interval bigger helps to eliminate this problem. If sitemap isn’t finished during one cron run then it can finish during the consequent runs.
Language settings:
If your site is multilingual pay attention to the Language settings. Open “Language settings” fieldset and select “Skip non-existent translations” - this will allow to not include non-existent translation into the sitemap.
Keep the checkbox: “Remove hreflang markup in HTML” - unchecked for site that have global audience.
Advanced configuration:
If you have redirects on your site from multiple domains to one, include base URL setting.
Select “Exclude duplicated links” checkbox.
Set amount of links to a reasonable number ~2000 max - your sitemap will be split into a few pages.
Set a sitemap generation time - it influences performance so make sure it’s not too high or too low. 10 is a reasonable starting number.
Multilingual sites setup
Content Translation Redirect module
This module allows to redirect to the default language if translation doesn’t exist.
Default settings
Install using composer
composer require drupal/content_translation_redirect
In the configuration section (admin/config/regional/content-translation-redirect)
Set redirect status to 302. Never set it to 301 unless you know the translation will never exist.
Optionally specify the message for redirection.
You can override the default settings by entity in the Entity Settings tab.
Preprocess hreflang attribute
It’s required to have hreflang attribute per language and region to help Google identify what content needs to be served for visitors in particular geolocation regions. It’s good practice for SEO. Make sure your sitemap includes hreflang alternate for every translation. They can be created using hook_page_attachments_alter
Rabbit Hole
Rabbit hole is a module that allows to avoid bots and users to access nodes and other entities that are not meant to have full page display. The example would be CTA content type nodes used inside views but not necessarily requiring full page display.
Install using composer
composer require drupal/rabbit_hole
Enable Rabbit Hole and Rabbit Hole Nodes, Rabbit Hole Taxonomies, and Rabbit Hole Users.
Configuration for each of these entity types can be found on the content type, user or vocabulary edit pages. Set them to default to Access Denied. These settings can be overridden on each respectful entity form.
The permission allows admins to still have full access to the page views of the rabbit holed entities.
Allows to also create published pages previews for internal review.
Metatag ecosystem
Make sure metatag module is installed. Global option is configured as well as options for content. Add metatag field to the content types to allow editors override keywords and descriptions as needed.
Make sure metatag is setup for views especially if you are using page displays on the site.
Install using composer
composer require drupal/metatag
Google Tag
It is preferable to install Google Tag module vs Google Analytics since this module provides more control and flexibility in terms of installation not only Analytics tag but also any additional trackers that might be required for SEO.
Install using composer
composer require drupal/google_tag
Make sure to adjust configuration to exclude any undesired tracking paths and to not track administrators and editors.
If you don’t redirect between hosting provided and custom domains, exclude tracking for hosting provided domains.
Depending on the client needs, exclude tracking on dev and stage environments domains.
Redirect
Setup and install redirect module.
Install using composer
composer require drupal/redirect
Setup default settings (admin/config/search/redirect/settings). For the first launch of the site make sure that the settings are set to 302 not 301 status. Check “Automatically create redirects when URL aliases are changed.” and “Retain query string through redirect.”
Make sure that you are enforcing clean and canonical URLs.
Pathauto
Install using composer
composer require drupal/pathauto
Update the settings for pathauto (admin/config/search/path/settings)
Make sure that all accessible through browser entities have URL pattern setup.
Work with the client to ensure the patterns strategy works for their business needs and minimizes the redirection effort where possible.
Pre-launch setup that pathauto creates a new alias and deletes the old one.
Make sure that strings that are set to be removed don’t impact existing aliases, contribute to creation of awkward aliases because of the removal of the conjunction word or changes the meaning. Work with client to identify potential risks.
Breadcrumbs modules
Easy Breadcrumb
Provides additional easy customization for breadcrumbs. Useful when breadcrumbs don’t have to match menu active trail.
Install using composer
composer require drupal/easy_breadcrumb
Adds current page as unlinked crumb. Edit / Hide home link, exclude pages, display unlinked paths.
Menu Breadcrumb
Allows to construct breadcrumb trail based on the active menu trail. Useful when aliases don’t match menu trail and it is important to use menu as a primary reference for the breadcrumb.
Install using composer
composer require drupal/menu_breadcrumb
Allows for easy exclusion of certain menus.