I'm trying to bulk update image tags using entity_metadata_wrapper.

I'm unable to see the image field when I use $emw->getPropertyInfo().

The bundle is called hub_page.

The code I'm using is:

$wrapper = entity_metadata_wrapper('node', $node_id, array('bundle' => 'hub_page'));

Is this the correct way?

1 Answer 1


You must pass in a node object as the second value, instead of a node ID.

$node = node_load($node_id);
$wrapper = entity_metadata_wrapper('node', $node, ['bundle' => 'hub_page']);

That might be your problem. Check out the docs: Entity metadata wrappers.

  • Thank @leymannx I'm using the node object but still not seeing the fields I'm expecting. Commented Oct 10, 2018 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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