Prevent submission of duplicate content in Drupal 8


We have a location entity (content type) which is referenced from other content (Programs, Organizations, Events, Places) on service providers on the Find It platform can re-use and share locations. Typing in addresses and zip codes is no one’s favorite thing.

But asking people to search before adding is only so effective. How do we prevent ending up with hundreds of duplicate locations?


Very old post but with an answer that almost stays relevant: is indeed a great module, unfortunately it doesn’t seem fully ported to Drupal 8.

It allows preventing duplicates (during validation, after submit is pressed) by validating a single field or comparing multiple fields.

(A similar module, which puts warnings in the user interface before submission, is — but it only works on one field at a time, as far as i can tell.)

Ideally, though, we do warn people as they are adding and let them pick the content they’re duplicating from a list.

Anti-Duplicates module operates only on the node title, which is a good start.

Unfortunately, our use case involves auto-generating the title from the other fields (especially the compound address field), so anti-duplicates as it currently stands is not helpful. Probably is the best module to build on, though.

Update: OK, Anti-Duplicates has some weak points:

Note: You do have to move the form element for the duplicate listing somewhere near the title for this to be reasonable, but it’s actually really cool that’s configurable.

Investigation continues in 2021

Suggest Similar Titles |

Intelligent Content Tools |

Places to report back to

See also