7 ways to optimize your Drupal content with Metatag

If you use Drupal 7.x and care about SEO, there's a good chance you have the Metatag module installed. But do you use it to its full potential? Metatag has come a long way since its former incarnation as Nodewords and boasts an expansive toolset for content writers and editors who want to optimize their Drupal pages for search engines and social networks. 

You will find the following optional settings in the "Meta tags" fieldset when creating or editing your Drupal content. You can also set default values that will be applied globally by navigating to Configuration > Metatag in the administration menu.

1. Image

This setting will tell crawlers which image they should use as a thumbnail when someone links to your post. If this is not specified, generally the first image on the page will be used (not always ideal). Facebook considers this the fallback if the Open Graph <og:image> tag is not specified (see more on Open Graph protocol, below). The image must be in GIF, PNG or JPG format and hosted on the same domain as the post.

Example mark-up:
<link rel="image_src" href="http://yourdomain.com/images/downtown-map.jpg" />

2. Author URL

Update 2014-09-01: Google has discontinued its support of Google+ authorship.

If you are active on Google+, or even just getting started, this is a field you should definitely consider. The value entered here will enable Google to connect your post to your G+ profile, effectively confirming authorship of the content. The reward for this is a higher page ranking over content scrapers, and an enhanced listing that includes your name, photo, and the number of G+ circles you belong to (Google recommends you have a "good, recognizable headshot" on your G+ profile). So: higher rank, better visibility, and the credibility earned from attaching your name to your work. How can you lose?

Example mark-up:
<link rel="author" href="https://plus.google.com/+StevenLevy/about" title="Steven Levy on Google+" />

3. Robots

These settings provide search engines with specific directions for what to do when this page is indexed. The checkboxes in this section add or remove <meta name="robots"> values to or from the page, and do not modify your website's robots.txt file. 

To offer up an example, there is an option that prevents search engines from indexing the page. Well, that's weird. Why would you not want search engines to index your page? Maybe you have another page with competing content that you have already optimized with the same keywords, or that has more conversion potential. If the former, Google will only pick one page so it might as well be one you have specified.  In the latter case, it just makes sense not to steal attention away from a page that has more value. 

Example mark-up: 
<meta name="robots" content="NOINDEX, NOFOLLOW" />

4. Canonical URL

A canonical URL is the accepted, standard URL for a particular piece of content on the internet. When the same content is available from two (or more) different URLs, it is considered by search engines to be duplicate content. If you are syndicating your content to different domains, this is intentional duplication that is in no way evil but can put the squeeze on your page rank if a preferred URL is not specified.

Most likely your duplicates aren't intentional, however. A few scenarios that can cause this:

  • Your Drupal content is accessible via system URL (e.g., node/1) as well as a "friendly" alias (e.g., products/packing-boxes). The Metatag module mitigates this problem out-of-the-box by setting a default global token that sets the URL alias as the canonical URL. (The Global Redirect module also addresses this problem by automatically creating 301 (permanent) redirects from the system path to the alias, which is essentially another method of canonicalizing a preferred URL.)

  • Your server is configured to serve the same content from the www subdomain, or the https protocol:

    http://yourdomain.com/url-alias
    http://www.yourdomain.com/url-alias
    https://yourdomain.com/url-alias

  • Your page uses dynamic URLS for searching content or tracking user sessions:

    products/packing-boxes?category=xxl
    products/packing-boxes?category=xxl&colour=purple

    See the Swedish Fish example at the Google Webmaster Central Blog.

Example mark-up:
<link rel="canonical" href="http://yourdomain.com/url-alias" />

Find out more about canonical URLs in Google Webmaster Tools Help

5. Open Graph protocol

So you've attempted to post a link on Facebook, and it just won't load the right image and/or description. It's happened to everyone, and it's sooo annoying. Even worse if the link belongs to you. 

The Open Graph protocol was originally created by Facebook, and is used to assign properties (e.g., title, url, image) to a page you want to share. The protocol refers to these pages as "graph objects". To turn your page into a graph object, you need to add the meta data.  Fortunately Metatag makes this easy with the submodule, Metatag: Open Graph.

Note: As of 2014-05-28 (version 7.x-1.0-beta9) the Metatag README.txt warns that there may be conflicts between the Drupal core RDF module and Metatag's Open Graph submodule. 

Example mark-up: 
<meta property="og:image" content="http://yourdomain.com/images/logo.png"/>

6. Twitter Cards

 A Twitter Card is a "rich snippet" attached to a tweet. There are different types of cards offered, each one suitable for a particular type of content. All of the cards provide for basic properties like image and description. You can also optionally attribute the content to your Twitter username. For all of the card types and their properties, visit this developer page.

Important: With Twitter you must validate your domain for each card type in order for it to function. Read Twitter's 4 Simple Steps. (Our approval for a summary card only took about a minute, even though it apparently can take weeks.) 

To enable Metatag settings for Twitter cards, enable the submodule Metatag: Twitter Cards.  

Example mark-up: 
<meta name="twitter:creator" content="@othermachines" />

7. Page title

OK, maybe you saw this at the very top of your page-level settings but weren't quite sure what it's for. After all, you have already entered a page title. Why do you need another?

This option allows you to provide an alternate page title that is optimized for search engines, while still keeping that snappy, perhaps not-so-SEO title on the post itself. Many things have been touted as essential to SEO, only to be dismissed months later. But this one remains as important as ever. 

Example mark-up:
<title>How to Pack Boxes More Efficiently | My Site Name</title>

More tips

  1. Use Google Webmaster Tools to analyze your page for structured data. 

  2. If using Twitter Cards for the first time, don't forget to validate your domain.

  3. You can combine Twitter Cards and Open Graph and avoid duplicate tags. See the documentation at Twitter Developers.

  4. Google truncates page titles in its results at 512 pixels (that's pixels, not characters), so try to keep to less than that. How? There's a tool for that

  5. Meta tag protocols are changing all the time, so keep yourself updated on new developments.

Have fun optimizing!