Facebook is planning to remove more than 5,000 ad targeting options in an effort to prevent discriminatory advertising.

The bulk of the 5,000 targeting options, slated for removal by this fall, could be used as proxies by advertisers looking to identify and exclude ethnic and religious groups.

A business that didn’t want Jewish people patronizing it could exclude those interested in “Passover” from seeing its ads. A landlord that didn’t want to rent to Native Americans could exclude those interested in “Native American culture.” Now, these options and thousands more like them are going away, a sign that Facebook is starting to come to terms with the various ways its platform can be manipulated.

“We’re committed to protecting people from discriminatory advertising on our platforms. That’s why we’re removing over 5,000 targeting options to help prevent misuse,” the company said in a blog post. “While these options have been used in legitimate ways to reach people interested in a certain product or service, we think minimizing the risk of abuse is more important. This includes limiting the ability for advertisers to exclude audiences that relate to attributes such as ethnicity or religion.”

Facebook’s removal of the targeting options comes amid an investigation from the US Department of Housing and Urban Development, which filed a complaint last week alleging Facebook had enabled discriminatory housing practices with its ad targeting options. The complaint began a process that could eventually lead to a federal lawsuit.

Facebook, which will also now require all US advertisers to…