I am new to Drupal and I just added a few buttons for sharing articles to social media (Facebook, Twitter etc.) I want to customize the appearance of sharing posts. After a few "research" I found out that I need to install meta-tags module to customize it...

The problem is that I can t figure it out how to change image or description. I tried but it didn`t work. This is how it looks like a shared article, banner image instead article image and description with irrelevant details.

enter image description here


Welcome to StackExchange!

Assuming you are using D8, here are some instructions (D7 would be similar but slightly different).

The metatag module has some submodules to help with various metatag usages. You will want to also enable the metatag_open_graph module. This will let you set the og* metatags.

First step in this is to go to the Content Type definition (structure->content types) for the page type (article?) you want to have metatag info on. You will need to select the Manage Fields option. Here you need to add a new field. Use the "Use an existing field" option and add the MetaTags field to the content type.

Repeat this for any other content types you want to have Metatag info added to.

Once you have done this, you can go into the configure / search and metadata / metatag screens and define the defaults you want either globally or for the specific content type. You can use "tokens" to indicate items from the node values. E.g. [current-page:title] or [node:field_featured_image] and the like. There is a browse available tokens to give you some guidance here.

Additionally, now that you have the metatag field added to the content type. You can also manually modify the metatags for any single node if you have the rights to modify the metatag info.

This can be done while editing the node and opening the MetaTag tab (generally at the bottom of the form).

To keep facebook and twitter happy I think you generally need the title metatag, og description field and the og image field set.

Good luck.

  • Thank you, I`ve got it, but it still takes the banner image instead of main article image. – Reflex Roland Nov 1 '18 at 21:23
  • Done! I solved it. – Reflex Roland Nov 1 '18 at 22:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.