PHP snippet · Performance

Disable emojis

Removes the emoji polyfill script, stylesheet, and DNS prefetch that WordPress loads on every page. Your emoji still work.

About this php snippet

WordPress prints an emoji detection script and a stylesheet on every page, front end and admin, so that older browsers can render emoji as images instead. Every browser in use today renders emoji natively, so this is pure weight on every single request.

Removing it does not stop emoji working in your content. It only removes the polyfill that nobody needs any more.

What it does

  • Removes the emoji detection script from the page head, from embeds, and from the admin
  • Removes the emoji stylesheet on both the front end and the admin
  • Stops emoji being converted to images in feeds and in outgoing mail
  • Drops the emoji plugin from the classic editor's TinyMCE build
  • Removes the DNS prefetch hint for the emoji CDN, so the browser stops opening a connection it will never use

Good to know

  • Emoji you type into posts, titles, and menus render exactly as they did before
  • Each hook is removed at the priority core actually registered it on, rather than assuming the default. Core does not use the same priority for all of them, which is why the copy and paste version of this snippet silently leaves some of it in place.
  • Nothing to configure. Activate it and it is done.

More php snippets

Your EMCP guide

Answers from our docs

YOUR CHAT, YOUR CHOICE

Before we chat

MSR Builds processes your question and up to four recent messages on our server to answer from the EMCP docs. AI is optional and needs your separate permission.

The chat is kept in this page's memory, not saved as a conversation in our database or browser storage. Our hosting and security services process connection information, such as your IP address, to prevent abuse.

Cloudflare Turnstile checks your browser and connection to prevent automated abuse when you send a question. No login is required.

Please leave out personal, sensitive or confidential information, passwords and API keys.

You can withdraw consent and clear this page's chat at any time. This cannot undo a request already sent or erase provider/security records.

Chat privacy, retention & your rights ↗ · Privacy contact

Starting chat consents to this processing. You can browse our docs without using the chat.