Last updated July 24, 2013. Created by mikeryan on July 24, 2013.
Log in to edit this page.

The Metatag module provides a destination handler which exposes all configured metatag fields for mapping. Making use of the handler is simple - if the metatag module is enabled, simply map values directly to the exposed fields:

<?php
$this
->addFieldMapping('metatag_title', 'legacy_seo_title');
$this->addFieldMapping('metatag_description', 'legacy_seo_description');
...
?>

Commonly, though, you won't be importing the metatag data, and all those unmapped metatag destination fields can clutter up your migration detail pages. Rather than explicitly mapping all the fields as DNM, you can simply disable the handler. In the Migrate UI, go to the Configuration tab and open the Handlers fieldset at the bottom. Under Destination handlers, uncheck MigrateMetatagHandler and click "Save handler statuses". Better yet, in the context of a large project where you want to be sure it's disabled for every environment, add the following to your migration module's .install file:

<?php
/**
* Implements hook_enable().
*/
function example_migrate_enable() {
 
_example_migrate_disable_handlers();
}
/**
* Disable migration handlers we don't want to use.
*/
function example_migrate_update_7100() {
 
_example_migrate_disable_handlers();
}
/**
* Disable handlers which only get in the way.
*/
function _example_migrate_disable_handlers() {
 
$disabled_handlers = unserialize(variable_get('migrate_disabled_handlers',
                                               
serialize(array())));
 
// We're not migrating metatag data, so save ourselves from explicitly
  // DNMing the fields all over the place.
 
$disabled_handlers[] = 'MigrateMetatagHandler';
 
variable_set('migrate_disabled_handlers', serialize($disabled_handlers));
}
?>

Looking for support? Visit the Drupal.org forums, or join #drupal-support in IRC.