Easy methods to Disable Emojis in WordPress (Step through Step)

by | Feb 25, 2023 | Etcetera | 0 comments

Are you looking to disable emojis for your WordPress web page?

Emojis are small icons which can be utilized to specific feelings or emotions. WordPress such a lot additional CSS and a JavaScript document with the intention to upload emoji give a boost to and a couple of consumers would possibly wish to remove it to enhance potency and tempo.

In this article, we’ll show you discover ways to merely disable emojis in WordPress.

How to disable emojis in WordPress 4.2

What Are Emojis?

Emojis are the tiny icons or smileys used on the web.

Originating from Japan, emojis have made their approach into the Unicode character set and are in truth supported thru desktop laptop methods along with iOS and Android cellular units.

The emojis function was once first introduced in WordPress 4.2 and the primary the reason why for together with this selection was once with the intention to upload native give a boost to for Chinese language language, Japanese, and Korean language character gadgets.

Emojis example

Via default, WordPress such a lot an additional JavaScript document and a couple of CSS with the intention to upload emoji give a boost to.

You’ll see it thru viewing your internet web page’s provide code or thru the usage of the Investigate cross-check instrument.

Emoji JavaScript in WordPress

Alternatively, some web page house owners would possibly wish to disable this extra emoji give a boost to to boost WordPress pace and function thru not downloading additional code and scripts.

See also  Learn how to Use the Critiques by way of Class WooCommerce Block

Understand: Once we say disabling Emoji in WordPress, we indicate disabling the extra tests and scripts used by WordPress to care for Emojis. You’ll however use Emoji for your web page, and the browsers that give a boost to them will however be capable of display them.

Having mentioned that, let’s take a look at discover ways to merely disable Emoji give a boost to in WordPress.

Approach 1. Disabling Emojis in WordPress The usage of Code

For the program, we’ll be the usage of a custom designed code snippet to disable emoji give a boost to in WordPress.

You’ll add this code snippet to your WordPress theme’ purposes.php report or a site-specific plugin. Alternatively, a tiny error throughout the code might merely break your internet web page and make it inaccessible.

To avoid this, we recommend the usage of WPCode. It’s the best code snippets plugin for WordPress and gives essentially the most safe approach with the intention to upload custom designed code to your web page without breaking it.

First, you wish to have to position in and switch at the WPCode plugin. For added instructions, see our data on learn how to set up a WordPress plugin.

After activation, simply cross to the Code Snippets » All Snippets internet web page from the WordPress admin dashboard.

From proper right here, you wish to have to click on at the ‘Add New’ button at the best.

Add new code snippet

This may increasingly an increasing number of take you to the ‘Add Snippet’ internet web page.

From proper right here, take your mouse over to the ‘Add Your Custom designed Code (New Snippet)’ selection and then click on at the ‘Use snippet’ button.

See also  5 Efficient Methods to Triumph over Undertaking Perfectionism
Click Use Snippet button

This may increasingly an increasing number of ship you to the ‘Create Custom designed Snippet’ internet web page. You’ll get began thru typing a name for your code snippet. It can be anything you like.

After that, you wish to have to select ‘PHP Snippet’ as your ‘Code Kind’ from the drop-down menu present in the proper corner.

Type a name for your code snippet and choose PHP as code type

Now all you wish to have to do is replica and paste the following code throughout the ‘Code Preview’ box.

/**
 * Disable the emoji's
 */
function disable_emojis() {
 remove_action( 'wp_head', 'print_emoji_detection_script', 7 );
 remove_action( 'admin_print_scripts', 'print_emoji_detection_script' );
 remove_action( 'wp_print_styles', 'print_emoji_styles' );
 remove_action( 'admin_print_styles', 'print_emoji_styles' ); 
 remove_filter( 'the_content_feed', 'wp_staticize_emoji' );
 remove_filter( 'comment_text_rss', 'wp_staticize_emoji' ); 
 remove_filter( 'wp_mail', 'wp_staticize_emoji_for_email' );
 add_filter( 'tiny_mce_plugins', 'disable_emojis_tinymce' );
 add_filter( 'wp_resource_hints', 'disable_emojis_remove_dns_prefetch', 10, 2 );
}
add_action( 'init', 'disable_emojis' );

/**
 * Clear out function used to remove the tinymce emoji plugin.
 * 
 * @param array $plugins 
 * @return array Difference betwen the two arrays
 */
function disable_emojis_tinymce( $plugins ) {
 if ( is_array( $plugins ) ) {
 return array_diff( $plugins, array( 'wpemoji' ) );
 } else {
 return array();
 }
}

/**
 * Remove emoji CDN hostname from DNS prefetching hints.
 *
 * @param array $urls URLs to print for helpful useful resource hints.
 * @param string $relation_type The relation kind the URLs are printed for.
 * @return array Difference betwen the two arrays.
 */
function disable_emojis_remove_dns_prefetch( $urls, $relation_type ) {
 if ( 'dns-prefetch' == $relation_type ) {
 /** This filter is documented in wp-includes/formatting.php */
 $emoji_svg_url = apply_filters( 'emoji_svg_url', 'https://s.w.org/pictures/core/emoji/2/svg/' );

$urls = array_diff( $urls, array( $emoji_svg_url ) );
 }

return $urls;
}
Paste your code snippet

After that, scroll proper right down to the ‘Insertion’ phase to select an insert means for your code.

Simply make a selection the ‘Auto Insert’ mode so that the code may also be robotically completed for your web page upon activation.

Choose Auto Insert as insert method

Now go back to the very best of the internet web page and toggle the switch at the correct from ‘Inactive’ to ‘Vigorous’.

See also  How Those 3 Content material Creators Became a Aspect Hustle Right into a Complete-Time Gig

In the end, click on at the ‘Save Snippet’ button to save some your custom designed code snippet.

Click the Save Snippet button to save changes

That’s all, you are going to have successfully disabled emojis in WordPress.

Approach 2. Disable Emojis in WordPress The usage of a Plugin

For the program, we’ll be the usage of a plugin to disable Emojis in WordPress.

First, you wish to have to position in and switch at the Disable Emojis plugin. See our data on learn how to set up a WordPress plugin for additonal instructions.

The plugin works out of the sector and there aren’t any settings so that you could configure.

Upon activation, it’s going to robotically disable emoji give a boost to from your WordPress web page.

We hope this newsletter helped you learn to disable Emojis for your WordPress web page. You may also want to take a look at our data on learn how to create a customized Fb feed in WordPress and our article on learn how to upload internet push notifications in your WordPress website.

Will have to you most well-liked this newsletter, then please subscribe to our YouTube Channel for WordPress video tutorials. You’ll moreover to seek out us on Twitter and Fb.

The publish Easy methods to Disable Emojis in WordPress (Step through Step) first appeared on WPBeginner.

WordPress Maintenance

[ continue ]

WordPress Maintenance Plans | WordPress Hosting

read more

0 Comments

Submit a Comment

DON'T LET YOUR WEBSITE GET DESTROYED BY HACKERS!

Get your FREE copy of our Cyber Security for WordPress® whitepaper.

You'll also get exclusive access to discounts that are only found at the bottom of our WP CyberSec whitepaper.

You have Successfully Subscribed!