The Essential Drupal SEO Modules

Published Aug 29, 2020
Updated Oct 19, 2024
By Simon
Table of contents

See the article on installing Drupal modules if you need to install these.

You will need to install the dependencies listed below to enable some of the recommended SEO modules. Drupal will notify you when you enable a module or if using Composer it will notify you at the time of running require.

If the module is not present in the modules' directory, you won't be able to select it to install, and it will tell you in the UI with a missing highlight. For more information on both modules, you can check the Drupal website.

Token https://www.drupal.org/project/token
Needed for Pathauto & Metatag.

CTools https://www.drupal.org/project/ctools
Needed for Pathauto.

I only recommend 3 modules to get going. I have listed a few others at the end you may like to look at if you are wanting to do more or want to improve the SEO of an existing Drupal site with lots of content. Below are the 3 modules all sites need if they are to implement modern SEO practices.

Pathauto

Your first piece of content created will be node/1, second node/2, and so on. Pathauto makes pretty URLs for you, that is, when you save your content it will generate a more friendly URL.

In the case of this page, the URL is /drupal-seo-modules. Pathauto needs to be configured once installed, but to get going you only need to generate a pattern for your content pages. 

To do this, go to the URL Aliases page in the Search and metadata section of Configuration and find the Patterns tab, click + Add Pathauto pattern

I suggest using the content title by entering the [node:title] token, you can browse all tokens from the token modal window by clicking Browse available tokens under the input. After making the pattern you can bulk update all previously published content, for full detail check below. Pathauto does much more, so have a look at the setting page.

Info

Actively maintained Yes
Requires Token & CTools

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

Basics

  • Set up a pattern at /admin/config/search/path/patterns. Patterns use tokens and hard codes paths. i.e [node:title] or /blog/[node:title]
  • If you already have content, then you need to go to  /admin/config/search/path/update_bulk and follow the instructions. You can also update from the node (content) edit form or use an Action on the Content overview page.

Remember also if you have redirect installed (next project module) it will create redirects for all new URLs, quite powerful stuff.

Redirect

The main reason we need this module is to enforce clean and canonical URLs, what I mean here is even though Pathauto makes a nice clean URL you can still visit the page at its node/# URL, Redirect will automatically redirect to the clean URL, so there is no chance of duplicate page indexing by search engines. 

It is also used to redirect when we rename pages and keep a record of it. 

If you change the name of your page URL alias multiple times before publishing, you might as well delete the redirects as they will never be needed.

Info

Actively maintained Yes
Requires no contributed project module, just a few core modules, i.e. no extras to install.

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

Basics

Enable Redirect module, and you are good to go, it's that easy. Do check the settings page and also the redirects page to see what options it has.

  • Doesn't work when the site is offline.
  • Has a couple of submodules you may find useful, check the Extend page.
  • Allows you to set the type of redirect; 301 permanent is the default and probably most used.

Metatag

Metatag can do the majority of your on-site and technical SEO by adding metadata to the head of the documents so search engines can more easily index your content. Metadata doesn't generally boost your rankings, but informs search engines of how you see your content. Metadata is not the be-all and end-all of SEO, but that is another story. I recommend downloading and enabling the Metatag module so that you have the tools at hand from day 1.

Info

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

Actively maintained Yes
Requires Token

  • Doesn't work when a site is off-line.
  • Has multiple submodules.

Basics

Out of the box it works, it adds canonical URL and title to all pages and adds a description to content pages, this module is so configurable and gives you everything you need for modern SEO through a plethora of modules from Open Graph to Dublin Core. Look on the extend page and enable what you need.

  • You will need to set up a description for your front-page, and decide on how you want to set up your descriptions (see next point) to start, but that's about it.
  • Descriptions by default show either the body content with no character limit or if you add a summary it will show that. Using the body content isn't ideal as it sets no limit, but a summary works. You can add a field specifically to use and then use a token to use the field; currently the default token is [node:summary], but you could add a field, say field_my_new_field, and then use the new field's token [node:field_my_new_field]. It's that easy.

Other Modules that you could need

I will write up about these in the weeks to come, on this site I am using Matomo Analytics, so I won't need Google Analytics module. I have used Google Analytics on other sites, Drupal 7 and 8 sites, and at its most basic it allows you to add your Google Analytics account number very easily. 

If you use Google Analytic, you can see the project module here https://www.drupal.org/project/google_analytics

Other modules that are also helpful are either Sitemap or sitemap XML. They make a nice XML sitemap at yourdomain/sitemap.xml.

I have written about XML Sitemap module here, or you can more details of either module on the Drupal website by following the links below.

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

SEO Checklist looks interesting, it helps you with the SEO process by suggesting things and project modules to use. I have never used this, but it could be useful, let's see as I work on some older sites.

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

Thanks for reading and be sure to follow on Twitter.

Tags