Requirements. First you need to have these installed:
- Drupal 7 or Drupal 8
- Metatag module
The Metatag module supports tags for common items such as your meta title, meta description, Facebook’s Open Graph, and Twitter cards.
Why does your website need metadata?
Website metadata bridges the gap between human and machine. Machines need the data and humans need the info.
Metadata tells search engines like Google what your page is all about. Even though many search engines are able to scrape your page title and content to use in their results listings, it is highly recommended you create those data points uniquely.
The title and description is what search engines display on their search listings.
Set up Default Drupal Metadata Configurations
Log in to Drupal and go to Configuration > Search and Metadata > Metatag
On the meta tag configuration page there are a few items you will want to update:
1. Configure You Home Page Metadata
Click edit next to Global: Front page and enter a unique Page title and Description in the fields provided.
I recommend entering a brief title that summarizes the purpose of your entire organization, followed by your organizations name. Use critical keywords in your title where appropriate.
Your title should be between 50-60 characters long. Google is known to increase this as needed, but make sure your most important info is within 50-60 characters.
Your description should contain an overall summary of your content within 150-160 characters. Occasionally Google will display up to 300+ characters to enhance search results. If you write a long description, at least make sure the most important details are within the first 150 characters.
2. Setup Drupal’s Global Metadata
Click edit next to Global.
Leave page title as default.
By default you should see this within the Page title field: [current-page:title] | [site:name] This will work well for the majority of your pages.
Add dynamic meta descriptions.
Let’s set this up to use the summary field by default. In the Description field, paste this token into the text box: [node:summary]
3. Add Dynamic Open Graph images for Social Sharing.
Social media sites like Facebook use the open graph meta tag for displaying meta information on sharing platforms. If you do not define an open graph image, social sharing sites will attempt to find the first or largest image to use as the image preview when sharing content on social media platforms.
To add a dynamic image field you must first create an image field and add it to all your content types.
After your image field is set up, insert the token into the image field within the Open Graph section.
If the machine name of your image is “field_image” your token should be entered like this: [node:field_image]
Test your new open graph image by going to Facebook’s sharing debugger and entering a url to a page that uses the new image
Note: We’ve seen issues in the past where the token method mentioned above does not work on specific versions of the metatag module. Reach out to our support team if you encounter issues within your environment.
These metatag tips should get you started down the road to building and providing meta information that’s critical to your SEO strategy.
Reach out to us for more help on topics like these.