Jun 28, 2019 in Drupal 8, Snippets

When importing content, it is really important you also think about meta tags on your import. Here's how to save them to nodes.

$node->set('field_meta_tags', serialize([
  'title' => $title,
  'description' => $description,
]));