Is this different than advertising in a magazine that has a specific reader demographic? Or would that get a company in trouble too, if a the court rules that the intent was to exclude a given group?
It's against U.S. federal law for employers to discriminate against people aged 40-or-over on the basis of age. Having job ads that only younger people could see would seemingly fall afoul of that law: https://www.eeoc.gov/laws/statutes/adea.cfm
It's even been to the Supreme Court[1]:
> In the 2004 decision General Dynamics Land Systems, Inc. v. Cline, the U.S. Supreme Court settled a conflict among the lower courts over the viability of so-called “reverse age discrimination” claims under the ADEA. Reverse age discrimination involves claims by younger employees who allege they have been discriminated against because of their youth.
> ...
> The Court observed that “if Congress had been worrying about protecting the younger against the older, it would not likely have ignored everyone under forty.”
> ...
> In the wake of the Cline decision, the Equal Employment Opportunity Commission (EEOC) issued a new rule in July 2007, which specifically addresses reverse age discrimination and provides that employers aren’t liable under the ADEA when they prefer older workers over younger ones. ...
> While a help-wanted notice can’t contain terms and phrases that limit or deter the employment of older employees, businesses may lawfully post advertisements that express a preference for older individuals.
[0]: https://www.eeoc.gov/youth/age.html
[1]: http://www.hrhero.com/hl/articles/2009/10/23/can-employers-d...