One of the most commonly used modules for helping with a Drupal 7 site’s SEO is Metatag. A rewrite of the Drupal 5 & 6 module Nodewords, Metatag provides a flexible system for customizing the meta tags used on a website. Using various meta tags it is possible to exert some control over how search engines analyze each page, and how the content looks when it is shared over social networks. It is this last aspect that many of us are focused on; given how many links are shared via Facebook, Twitter, et al, being able to control how the page summaries are displayed, rather than relying upon automated algorithms, can be tremendously beneficial.
The new v7.x-1.5 release of Metatag brings many improvements to Drupal sites that will make the site builder’s life easier. A key example of this is in how it controls what types of entities (content, taxonomy terms, users, comments, commerce products, etc) have the “meta tags” fields on their edit pages. While Drupal’s built in entities were always supported, previous versions required developers to specifically program support for Metatag into their custom modules and custom entities. The new 1.5 release does away with that system, replacing it with a simple set of checkboxes on Metatag’s settings page, putting it in full control of the site builder.
Speaking of meta tag forms, there are now almost 250 different meta tags available! Previous releases supported the common meta tags, like “description”, “keywords”, the Open Graph, Dublin Core and Twitter Cards standards, and even the page title. The new release adds:
- The App Links meta tags,
- Several meta tags for site verification with various search engines,
- Geographical meta tags like “geo.position” and “geo.placename”,
- Frequently used mobile-specific tags,
- Twenty four new Open Graph tags for describing product details,
- Twelve different favicon meta tag varieties,
- Thirty nine additional Dublin Core tags.
For sites that are upgrading from Drupal 6 and used Nodewords, there is now a “Metatag: Importer” submodule for automatically converting data from the old Nodewords module. Currently this handles all tags for nodes (“content”), taxonomy terms and users, along with global, front page and error page configurations, which should cover the vast majority of use cases. It should be noted that per-page meta tags are not upgraded yet. Hopefully, that will come with a future release.
It is also finally fully supports using the values of one meta tag in another. For example, it might be useful to customize the regular “description” field and then use that value for each of the Open Graph, Twitter Cards and Dublin Core “description” fields - this now works correctly!
One problem that used to trip up many sites was that the meta tags would not display on the front page, either because of a custom template being used or the site’s base theme was doing something odd. Both cases were almost always because Metatag was expecting a specific template “region” to be available, so if the theme was customized to the point that the region didn’t exist, then the meta tags were not displayed. The new version includes an option to control which template region is used to trigger the output, doing away with much hackery and custom code that some site builders had to resort to.
There are also a wealth of fixes beneath the surface. The aforementioned logic for controlling which entities are supported simplifies some of the underlying logic and removes some oddities that would arise when, for example, some of the global settings were disabled. There are also fixes for editing taxonomy terms, for exporting the configuration using Features, and many more.
Metatag 1.5 includes 79 commits since version 1.4 was released in October, 2014, including 51 since 1.5-beta1 was released this past February. The vast majority of these were through collaboration with the many contributors who have helped bugfix, fine-tune and improve Metatag, helping to make it an extremely powerful solution for improving Drupal sites. My thanks are due to everyone who helped - without this help Metatag wouldn’t be the module it is today. Furthermore, I don’t just thank those who contribute patches, but also everyone who asked for a new meta tag to be added, who helped test a patch, who asked how the module should be used, even those who said “me too” when someone else discovered a bug - I’m grateful for everyone who has added their voice to the discussions.