WARNING: The following instructions are for advanced users. Please proceed with caution​:stop_sign:
NOTE: If you operate a highly-available Mattermost cluster these steps must be applied to all Mattermost Server application nodes​:information_source:
These changes will need to be re-applied any time there is an upgrade to Mattermost server​:warning:
There are a variety of reasons why you may need to remove the built in emojis that Mattermost ships with. For this post I’ll bucket them all under one heading of “Not appropriate for end-user community”.
Mattermost ships with a large library of existing emoji that is similar to what is available through your device operating system keyboard (see our docs on how to access the OS/keyboard emoji on different clients), but not exactly the same. The following steps explain how you can manually remove a specific emoji from the Mattermost client. Note, this will not affect the emoji that are available from your keyboard.
- Identify the name of the emoji you want to remove. On the desktop client you can open the emoji picker and hover over the one you want to remove. In the following screenshot I’m hovering over the poop emoji, so the name is
hankey
. Make note of this term, and the other terms which are aliases of this emoji.
- Under the Mattermost installation directory
INSTALL_DIR
(typically/opt/mattermost
) navigate to theINSTALL_DIR/client
- There are 2 files you’ll need to edit and they are very dense with characters (these are minified/process javascript files). First you need to find the files.
/opt/mattermost/client$ grep -o hankey *
main.0f2d0e1224bffaa8a2da.js:hankey
main.0f2d0e1224bffaa8a2da.js:hankey
main.0f2d0e1224bffaa8a2da.js.map:hankey
Here we have our 2 files: main.0f2d0e1224bffaa8a2da.js
, and main.0f2d0e1224bffaa8a2da.js.map
.
Note: The files are very large minified javascript, so some editors may have a hard time. I used vim
for this
- Backup the
js
file somewhere in case you make a mistake. Open thejs
file and search for the emoji you want to remove. There are 2 places where the emoji should appear:
a) See following image. All 3 versions of the poop emoji are listed (“hankey”, “poop”, “shit”). We need to remove all of this [\"hankey\",79],[\"poop\",79],[\"shit\",79],
(NOTE: The trailing comma must be removed too… this is part of a list). Save the file in place.
b) See the following screenshot. Remove the entire json block (including trailing comma) that starts with “aliases”
{"aliases":["hankey","poop","shit"],"filename":"1f4a9","category":"people","batch":"2"},
5. Backup the
js.map
file somewhere in case you make a mistake. Open the js.map
file and search for the emoji you want to remove the same as in step 4. All 3 versions need to be removed. This file was extra tricky as the size really made my editor slow down. Save the file in places.
-
Hard refresh your Mattermost client (CTRL/CMD-R).
-
Search the emoji picker for the emoji you just deleted. Confirm it is no longer available.
Let me know if you have any questions.