Last active
March 20, 2019 13:17
-
-
Save deeman/9a3dfedec72715bdb5c3d26d3bd67e02 to your computer and use it in GitHub Desktop.
Remove/disable Emoji's in WordPress
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| //* Do NOT include the opening php tag shown above. Copy the code shown below into functions.php | |
| /** | |
| * Remove emoji support. | |
| */ | |
| function grd_remove_emoji() { | |
| remove_action( 'wp_head', 'print_emoji_detection_script', 7 ); | |
| remove_action( 'admin_print_scripts', 'print_emoji_detection_script' ); | |
| remove_action( 'admin_print_styles', 'print_emoji_styles' ); | |
| remove_action( 'wp_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' ); | |
| // Remove from TinyMCE | |
| add_filter( 'tiny_mce_plugins', 'grd_remove_tinymce_emoji' ); | |
| } | |
| add_action( 'init', 'grd_remove_emoji' ); | |
| /** | |
| * Filter out the tinymce emoji plugin. | |
| */ | |
| function grd_remove_tinymce_emoji( $plugins ) { | |
| if ( ! is_array( $plugins ) ) { | |
| return array(); | |
| } | |
| return array_diff( $plugins, array( 'wpemoji' ) ); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment