Dynamically remove entity_reference value from views exposed filter via flag
Issue:
A views filter based on taxonomy terms should not show all terms as filterable options, e.g. because they are internal
Solution:
Create a field on your taxonomy to determine whether it should be included in filters, then alter your form so it reacts to the field setting. You can copy-paste the code provided into your module.