I haven't tried to lower the settings in a situation where no extra data would prevent it, but it seems it is possible: Changing cardinality lower than highest existing delta causes data loss upon save.
But assuming it can be done, you can also create Views to list content with more than one term in a multi-valued field.
Fields with multiple values track the values with Delta
starting from 0
. Field with one value has Delta 0. Field with 2 values, has Delta of 0
for the first value, and Delta of 1
for the second value etc.
- Field
- Value 1 (Delta: 0)
- Value 2 (Delta: 1)
- Value 3 (Delta: 2)
- …
Delta is available in Views. This means you can Filter content with regard to it, which is what you want.
- Create Views of type Content with Filters and Fields appropriate for your initial situation, show Title and the Taxonomy field in question so you can check the results (you probably already have this covered)
- Add a Filter of your field Delta. It will be called something like MyTags (field_mytags:delta). If you search for your field name it will list both your field and the Delta, choose the Delta option.
- Set the
Operator
of the Delta Filter to Is equal to and enter 1
This will list all the nodes (provided your other filters are set appropriately) where the second position in the Taxonomy field isn't empty. Meaning there are at least 2 terms recorded in that field. The nodes will only be listed once.
If you set the Delta Filter Operator to Is greater than
0
, as you may be tempted, it will also list the nodes that have more than one term in that field, but it will list them as many times as there are terms on that node minus 1. So if a node has 3 tags, it will be listed twice, because it will list one result for each Delta above 0.
With this result, you can go on to use Views Bulk operations to edit the listed "offenders", by coding an operation that deletes all but the first value from that field. Or even manually edit each node if coding is not an option.