How to set / remove drupal 8 meta tags

- 1 answer

Ad

Adding meta tags to drupal 8, how to do it "drupal" way ? Meta tags like keywords, description, author etc.

Removing drupal own metatags like:

<meta name="Generator" content="Drupal 8 (https://www.drupal.org)" />
<meta name="MobileOptimized" content="width" />
<meta name="HandheldFriendly" content="true" />

I have added the meta tags currently just to html.html.twig file. There seems to be module which is in beta stage, but if possible, I would like to avoid using 3rd party modules for this at the moment.

Ad

Answer

Ad

The Meta tags module requires you to install three modules:

You will see that the Meta Tags module comes with additional modules you can enable it.

Configure Meta Tags Module

Meta Tag Configuration In Drupal

  • Click on Configuration in the black admin menu bar
  • Click on Meta tags in the Search and Metadata box on the left side of the screen.

Notice there are four global settings.

  • Click on each and observe what you get by default. All nodes, terms, and users will have the same configuration by default. But that doesn't have to be the case.

Now add default Meta Tag.

  • Click on Add a meta tag default.

  • Selet Article from the Type dropdown. Enter the token [node:content-type:description] in the abstract field. Save When you create an Article node from now on, the description of the Article content type will appear as such:

Adding Meta Tag

Now its time to enter the meta tag data with in the site.

enter image description here

These are some of the basic steps you can follow to add Meta Tag in Drupal. Please follow the steps and let me know if there are any other issue you get.

(Credit: https://www.ostraining.com/blog/drupal/meta-tags/)

Ad
source: stackoverflow.com
Ad