Bingo!
Thanks a lot.
I added the following code on top of view/omeka/site/item/show.phtml
in my theme, and this seems to behave as expected.
I’ll deploy this on my public server and hopefully search engines will adapt after their next crawl.
<?php
$sites = $item->sites();
if (count($sites) > 0) {
if (in_array($site, $sites)) {
echo $this->headMeta()->appendName('robots', 'index');
} else {
echo $this->headMeta()->appendName('robots', 'noindex');
}
} else {
echo $this->headMeta()->appendName('robots', 'noindex');
}
?>
N.B. if anybody else sees this, they may want to consider that the last line starting with echo in the above chunk sets the ‘noindex’ tag for items that are not added to any sites. I can imagine cases where others may want to have them indexed instead.