Can Class Names Trigger Safe Search Filters?

Avatar of Chris Coyier
Chris Coyier on (Updated on )

I got a tweet about this a while back, and it’s been on my list of things to attempt to start a discussion about. Or even better, gather some real data about. It also might be a smidge related to SEO (as the asker leads with), and since yesterday’s baby thought about SEO, it reminded me of this.

Here’s the question:

In other words, HTML like this:

<label for="sex">Sex:</label>
<select id="sex" name="sex">
  <option>Yes, please</option>
  <option>Honk honk</option>
  <option>Wakka Wakka</option>

Silly attempts to thwart being gender normative aside, is simply the presence of the word “Sex” on the page enough to trigger warnings, blockage, or exclusion from certain apps? Perhaps an app using Google Safe Browsing APIs, a firewall of sorts configured for blocking certain content, or some other kind of software designed to filter web content.

What if your business was Barry’s Delicious Smoothie Mart so you prefixed a bunch of your CSS selectors:

.bdsm-header {
  background: papayawhip;

Will there be unintended consequences there?

I’m having a bit of Deja Vu about this conversation, in which I remember seeing a conversation about this somewhere where someone said this has indeed caused some minor problems for them, but I can’t seem to dig that up right now.

In fact, I don’t have any personal stories or data to share with you on this subject, I just wanted to open it up for comments from folks that actually do have some data.

In spending some time searching around about this issue, I found plenty of “experts” chiming in saying “no, CSS classes don’t affect anything.” That stands to reason, but there is no data cited, references provided, or proof supplied. But also note in our first example, the text we were worried about is “sex”, and it doesn’t only appear in classes, but other attributes as well, not to mention the actual visible text of the label.

So if you know something for real, let us know below.