Metadata and meta tags

Metadata editing interface in Drupal


What is metadata?

On the web, metadata and meta tags are used to add technical details in the background of a page in order to help catalogue the content and assist tools like search engines in indexing the content. Some meta tags, like "character set (charset)", are often automatically applied by content management systems; others, like "keywords", typically have to be manually defined by a user.

What meta tags are available?

The University of Ottawa's Drupal platform makes use of the Metatag module as well as four of its submodules for OpenGraph, Twitter Cards, Facebook and Panels. These modules allow you configure a good hundred different metatags. Of these, the most important tags to retain are the following:

Basic tags

  • Page title
  • Description
  • Keywords

Advanced tags

  • Prevent search engines from indexing this page.
  • Prevent search engines from following links on this page.
  • Prevent cached copies of this page from appearing in search results.

Open Graph

The Open Graph meta tags are used to control how Facebook, Pinterest, LinkedIn and other social networking sites interpret the site's content.

  • Content type
  • Page URL
  • Content title
  • Content description
  • Image
  • Locale
  • Alternative locales

Twitter Card

Since Twitter does not follow the Open Graph standard, separate meta tags are needed to control the summaries displayed when content is shared on Twitter.

  • Twitter card type
  • Page URL
  • Title
  • Description
  • Image URL
  • Image alternative text

How to add or edit meta tags?

For simple pages (i.e. nodes)

All user roles have access to do the following:

  • Start by editing the page desired (e.g. a basic page or a news article).
  • Scroll about half-way down the page until you see the collapsed section "Meta tags". Click on it to expand it.
  • Alter any meta tag as needed. For example, enter a comma-separated list of keywords about the page in the "Keywords" field.
    • For some metadata, you might want to reuse values from other fields using tokens. For example, the "Description" field uses the token "[node:uottawa_summary]" which automatically pulls the text from the "Summary" field by default.
  • Once done, enter a revision log message and save the page.

For complex pages (i.e. panel pages)

Webmasters and administrator-level users can add metadata to Panel pages by following the steps below:

  • Go to Structure and then Pages.
  • Find the page desired and click on Edit.
  • In the left menu, click on Meta tags.
  • Select the box "Enable Metatag configuration".
  • Alter any meta tag as needed. For example, enter a comma-separated list of keywords about the page in the "Keywords" field. By default, you should only enter content in English for Panel pages. 
  • Once done, click on Update and save.
  • Lastly, we will need to translate the metadata we added.
    • For this, go to Configuration and then Translate interface.
    • At the top-right, click on Translate.
    • Do a search for any text you entered in the meta tag fields. Then, edit the string to translate it.
    • Repeat for all other text strings you added.

How to set default metadata values across a site? (administrators only)

Administrators have the ability to set some default values for meta tags at the site-level. For example, if an administrator wanted that all new nodes created start with the default keyword "hello", they could configure this.

To do so:

  • Navigate to Configuration and then Metatag.
  • Find the type of content you wish to target (e.g. Nodes) and click on either "Edit" or "Override".
  • Modify the desired metatag as necessary.
    • For example, in the field "Keywords", enter "hello". Now, all nodes that you create from this point on will be pre-filled with the meta keyword "hello".
    • Consider using tokens too. For example, the default value for the Open Graph Image meta tag could be the node's primary image: "[node:uottawa_primary_image]".
  • Save your changes.
» Submit feedback
  • Support
  • User Guide
Back to top