Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Font icon names are indexed by search engines #498

Closed
deepfriedbrain opened this issue Oct 5, 2016 · 12 comments · Fixed by angular/components#24578
Closed

Font icon names are indexed by search engines #498

deepfriedbrain opened this issue Oct 5, 2016 · 12 comments · Fixed by angular/components#24578

Comments

@deepfriedbrain
Copy link

I'm using font icons in my page h1 header for e.g.:

<i class="material-icons">thumb_up</i> My Page Title</h1>

I noticed that my page shows up as thumb_up My Page Title in Google SRPs. Is there a way to avoid this, other than removing the icons from the header or switching to image icons?

Thanks.

@shyndman
Copy link
Contributor

shyndman commented Oct 5, 2016

Hi @deepfriedbrain,

In this case, we recommend that you reference the icon using its codepoint. For thumb_up, you'd write this:

<i class="material-icons">&#xE8DC;</i>

You can find the complete mapping between icon names and their codepoints here: https://github.com/google/material-design-icons/blob/master/iconfont/codepoints

@shyndman shyndman closed this as completed Oct 5, 2016
@deepfriedbrain
Copy link
Author

That's what I ended up doing but it's a very poor workaround. I lose the advantage of using readable icon names or add those readable names as comments wherever I'm using Material Icons.

Why doesn't Material Icons use the approach similar to Font Awesome (make the icon name a CSS class)? Were you not aware of the problems with search engines (especially Google) indexing those names?

@MrXyfir
Copy link

MrXyfir commented Mar 16, 2018

A year and a half later, are there any better solutions for this yet?

@ZdrowyGosciu
Copy link

Maybe this solution could help https://stackoverflow.com/questions/37281861/how-to-use-google-material-icons-as-class-instead-of-i-tag

@ghost
Copy link

ghost commented Jul 25, 2020

This problem is huge problem for SEO

And

I prepared a repository for solution(SEO Friendly).
You can use material-icons font as css classes like Font Awesome, etc.
https://github.com/voyula/material-icons-font-classes

<!-- Using of material-icons font with classes. -->
<span class="material-icons m_i_ICON_TAG_HERE"></span>

<!-- Example -->
<span class="material-icons m_i_home"></span>

Please give star to repository to make people reach.

@kjdeepak
Copy link

Hi @deepfriedbrain,

In this case, we recommend that you reference the icon using its codepoint. For thumb_up, you'd write this:

<i class="material-icons">&#xE8DC;</i>

You can find the complete mapping between icon names and their codepoints here: https://github.com/google/material-design-icons/blob/master/iconfont/codepoints

This link is no more working. Did any one found solution to this issue?

@MrXyfir
Copy link

MrXyfir commented Sep 19, 2020

The best solution is don't use font icons. Use SVG icons.

@marvinpoo
Copy link

Any official updates to this?

@PowerKiKi
Copy link

The attribute data-nosnippet, as detailed in https://developers.google.com/search/docs/advanced/crawling/special-tags#data-nosnippet, can be used to workaround this issue, at least for Google.

@remixer-dec
Copy link

There's a more recent answer in stackoverflow thread mentioned above, which offers a pretty convenient solution. Similar solution is also mentioned in a linked issue.

@PowerKiKi
Copy link

https://stackoverflow.com/a/61659184 is great, but unfortunately it requires control of the DOM, like all other answers I've seen here. And since I'm using those icons via Angular components mat-icon, it's unfortunately not an option (AFAIK).

PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Mar 11, 2022
The new way to use ligature icons, via a dedicated attribute, allow to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusingto read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Mar 11, 2022
The new way to use ligature icons, via a dedicated attribute, allow to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusingto read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Mar 11, 2022
The new way to use ligature icons, via a dedicated attribute, allow to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusingto read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 1, 2022
The new way to use ligature icons, via a dedicated attribute, allows to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 1, 2022
The new way to use ligature icons, via a dedicated attribute, allows to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 1, 2022
The new way to use ligature icons, via a dedicated attribute, allows to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 1, 2022
The new way to use ligature icons, via a dedicated attribute, allows to hide
the font name from search engine results. Otherwise the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>my-icon-name</mat-icon>
+ <mat-icon icon="my-icon-name"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 2, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 2, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `mat-ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 2, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `mat-ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
PowerKiKi added a commit to PowerKiKi/material2 that referenced this issue Apr 2, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `mat-ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes angular#23195
Fixes angular#23183
Fixes google/material-design-icons#498
andrewseguin pushed a commit to angular/components that referenced this issue Jun 27, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `mat-ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes #23195
Fixes #23183
Fixes google/material-design-icons#498
andrewseguin pushed a commit to angular/components that referenced this issue Jun 27, 2022
The new way to use ligature icons, via the `fontIcon` attribute, allows to hide
the font name from search engine results. Otherwise, the font name, which was
never intended to be read by any end-users, would appear in the middle of legit
sentences in search results, thus making the search result very confusing to read.

New recommended usage is:

```diff
- <mat-icon>home</mat-icon>
+ <mat-icon fontIcon="home"></mat-icon>
```

To also enable this for custom font, include the special `mat-ligature-font` class
when registering the font alias. So like this:

```ts
iconRegistry.registerFontClassAlias('f1', 'font1 mat-ligature-font');
```

And use like this:

```html
<mat-icon fontSet="f1" fontIcon="home"></mat-icon>
```

Fixes #23195
Fixes #23183
Fixes google/material-design-icons#498

(cherry picked from commit b37c96d)
@crustamet
Copy link

THIS IS NOT FIXED WHATSOEVER THE CODEPOINT IS A WORKAROUND. this workaround only works on google search but does not work on other search engines
GOOGLE IS NOT THE ONLY SEARCH ENGINE ON THE PLANET!!!

image
image

"Seo friendly ligature icons" my ass. What happened to the old ?

        <i class="material-icons md_thumb_up"></i>

this should work as before and my example is seo friendly because there is no text to get indexed.
While other codepoints if you search the codepoints on google its still gets indexed LOL

image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

9 participants