Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Why unicode emojis in wordpress displayed with <img> tag?

In wordpress when I use a unicode emoji like "😑" or others, wordpress convert emoji character to <img> tag with src="emoji.svg" and alt="😑" like this:

<img draggable="false" class="emoji" alt="😑" src="https://s.w.org/images/core/emoji/11/svg/1f611.svg">

Imagine I want to use 50 emoji in a text, this is very bad in SEO and for site performance. Is there a way to keep the emoji as unicode? Like here on Stack Overflow and other websites?

Thanks a lot!

like image 975
mos2fa Avatar asked Oct 23 '18 13:10

mos2fa


1 Answers

There is a great answer here on wordpress development that tells you how to disable the svg styled icons, its this line:

add_filter( 'emoji_svg_url', '__return_false' );

Also check out the other hooks that you might need to fully disable emojis.

Wordpress uses svg emojis for two reasons I think:

  1. Their emojis are more "flat" and therefore look more modern
  2. When being used as images, emojis can have different sizes than the text sourrounding them.
like image 200
niklas Avatar answered Sep 21 '22 13:09

niklas