I recall that there is a general recommendation to have a max limit on the amount of filter feeders in a diet because they have an above average in toxins and heavy metals. There have been suggestions to use such animals to explicitly clear out runoff from terrestrial farms and industries, but then the toxic levels would be so high that the meat is no longer be suitable for human consumption.
That said, they are a delicious source of food that is superior to other meat in many aspect, including being very ecology friendly and space efficient. Anyone that is trying to minimize the damage that a diet has on the environment should consider adding them.
In France, where there are a lot of oyster and mussel farms along the Atlantic coast (apparently, modern oyster farming was invented there in the mid 19th century) warnings and restrictions are regularly issued because of pollution from natural or land farming-related causes, or mollusc diseases.
Shellfish farming is very efficient and ecological, in addition to having cultural value as a traditional local activity, but it does have drawbacks.
I'm having a hard time finding official advice to avoid shellfish that doesn't advise avoiding fish too[1]. In fact, the FDA lists scallops, clams, shrimp, and oysters as having the lowest amount of mercury[2].
It looks like some shellfish toxicity is due to cyanobacteria[3], which is mostly caused by eutrophication from farm runoff. But scaling this system should help with that.
That said, they are a delicious source of food that is superior to other meat in many aspect, including being very ecology friendly and space efficient. Anyone that is trying to minimize the damage that a diet has on the environment should consider adding them.