Troubleshooting: Why Your Custom Styles Disappeared from the TinyMCE Advanced Formats Menu
Content
Many users of the TinyMCE Advanced plugin have encountered a frustrating issue: custom styles from their editor-style.css file or custom style_formats array suddenly vanish from the Formats dropdown menu. This problem often appears after a WordPress core or plugin update, leaving content creators without their essential formatting tools.
Based on community reports and solutions, here are the most common causes and their fixes.
Why This Happens
The issue typically stems from one of a few key areas:
- Cache Issues: Browser and WordPress caching can be extremely "sticky," preventing the updated
editor-style.cssfrom loading in the TinyMCE iframe. - Missing Formats Button: A very common culprit is the "Formats" button itself being absent from the active toolbar. This button must be present to access any custom styles.
- Conflicting Settings: The "Create CSS classes menu" option within TinyMCE Advanced can sometimes interfere with other methods of adding styles, especially if used alongside other TinyMCE-enhancing plugins.
- Plugin Conflicts: Other plugins, like Jetpack, may inject their own styles and override your custom
style_formatsconfiguration. - KSES Filtering (Multisite/User Roles): On WordPress Multisite installations or for users without the 'unfiltered_html' capability, WordPress's KSES security filters may strip out inline styles like
list-style-typeupon saving.
How to Fix It: Step-by-Step Solutions
1. Clear All Caches and Check for 404 Errors
This is always the first step. Clear your browser cache and perform a hard reload (Ctrl+F5 or Cmd+Shift+R). Also, check your browser's developer console (F12) for any 404 errors trying to load editor-style.css. If the file isn't found, ensure it is in your active theme's root directory.
2. Verify the Formats Button is on the Toolbar
This is the most frequent solution. The custom styles are accessed through the "Formats" button.
- Go to Settings > TinyMCE Advanced.
- In the toolbar configuration area, locate the "Formats" button. It is often in the "Unused Buttons" section.
- Drag the "Formats" button into one of your active toolbars (e.g., Toolbar 2).
- Save your settings and check the editor again.
3. Manage the "Create CSS classes menu" Setting
This powerful setting tells TinyMCE Advanced to automatically parse your editor-style.css and populate the Formats menu with the classes it finds. However, it can conflict with custom style_formats code from your theme's functions.php or other plugins.
- If you want to use your manual
style_formatsarray, ensure this option is unchecked. - If you want TinyMCE Advanced to handle it automatically, ensure this option is checked and that your
editor-style.cssfile is present. Note: You may need to save the settings page twice for this change to take full effect, as a bug has been noted in this process.
4. Check for Plugin Conflicts
Temporarily disable other plugins, especially those that modify the editor like Jetpack or other TinyMCE extensions. If your styles reappear, you've found a conflict. You will need to reconfigure the conflicting plugin or adjust your custom code to ensure it loads with a higher priority.
5. Resolve KSES Filtering for User Roles (Multisite)
If list styles or other inline styles are being stripped for Editors or Authors, you need to modify the allowed CSS attributes. Add the following code to your theme's functions.php file to allow the list-style-type attribute:
function my_theme_allow_list_styles( $styles ) {
$styles[] = 'list-style-type';
return $styles;
}
add_filter( 'safe_style_css', 'my_theme_allow_list_styles' );
6. Force a Cache Busting Parameter
To force browsers to load a fresh version of your editor-style.css, you can add a version parameter. Add this code to your theme's functions.php:
function my_theme_editor_style_version( $url ) {
if ( strpos( $url, 'editor-style.css' ) !== false ) {
$url = add_query_arg( 'ver', time(), $url );
}
return $url;
}
add_filter( 'style_loader_src', 'my_theme_editor_style_version' );
By methodically working through these steps, you should be able to restore your valuable custom styles to the TinyMCE editor. The most common fix is simply ensuring the "Formats" button is enabled on the toolbar.
Related Support Threads Support
-
Latest update broke my iconshttps://wordpress.org/support/topic/latest-update-broke-my-icons/
-
Divi conflict (missing styles in the backend)https://wordpress.org/support/topic/divi-conflict-missing-styles-in-the-backend/
-
Default TinyMCE 5 icons? Adding | separator?https://wordpress.org/support/topic/default-tinymce-5-icons-adding-separator/
-
Custom Sstyles on format drop down stopped workinghttps://wordpress.org/support/topic/custom-sstyles-on-format-drop-down-stopped-working/
-
WP update causes unwanted font in visual editorhttps://wordpress.org/support/topic/wp-update-causes-unwanted-font-in-visual-editor/
-
TinyMCE advanced problemshttps://wordpress.org/support/topic/tinymce-advanced-problems-1/
-
Editors and list style optionshttps://wordpress.org/support/topic/editors-and-list-style-options/
-
TinyMCE Advanced lost custom formats on upgrade to 4.0,2https://wordpress.org/support/topic/tinymce-advanced-lost-custom-formats-on-upgrade-to-402/
-
Custom style_formats is not working when Jetpack is activatedhttps://wordpress.org/support/topic/custom-style_formats-is-not-working-when-jetpack-is-activated/
-
Advanced List Styles Not Saving in WordPress Multisite for Role Administratorhttps://wordpress.org/support/topic/advanced-list-styles-not-saving-in-wordpress-multisite-for-role-administrator/
-
editor-style.css does not work anymore since updatehttps://wordpress.org/support/topic/editor-style-css-does-not-work-anymore-since-update/
-
the styles in editor-style.css are no longer being rendered in the editorhttps://wordpress.org/support/topic/the-styles-in-editor-stylecss-are-no-longer-being-rendered-in-the-editor/
-
Font and size not workinghttps://wordpress.org/support/topic/font-and-size-not-working/
-
Not showing styles drop since upgradehttps://wordpress.org/support/topic/not-showing-styles-drop-since-upgrade/
-
editor-style.css and Formats Menu Separation?!?https://wordpress.org/support/topic/editor-stylecss-and-formats-menu-separation/
-
style_formats_merge and style_format doesn’t workhttps://wordpress.org/support/topic/style_formats_merge-and-style_format-doesnt-work/
-
TinyMCE Advanced: Can’t select some formatshttps://wordpress.org/support/topic/tinymce-advanced-cant-select-some-formats/
-
Create CSS classes menu toggles wrong way roundhttps://wordpress.org/support/topic/create-css-classes-menu-toggles-wrong-way-round/
-
Format dropdown blankhttps://wordpress.org/support/topic/format-dropdown-blank/
-
No longer seeing effects of editor-style.csshttps://wordpress.org/support/topic/no-longer-seeing-effects-of-editor-stylecss/
-
Editor Styles Not Workinghttps://wordpress.org/support/topic/editor-styles-not-working/
-
Force editor-style to reloadhttps://wordpress.org/support/topic/force-editor-style-to-reload/
-
Applying custom styles onhttps://wordpress.org/support/topic/applying-custom-styles-on/
-
Headings and tables not workinghttps://wordpress.org/support/topic/headings-and-tables-not-working/
-
valid_children not workhttps://wordpress.org/support/topic/valid_children-not-work/
-
Formats menu selects wrong paragraphshttps://wordpress.org/support/topic/formats-menu-selects-wrong-paragraphs/
-
tadv_settings not saving properly re ‘importcss’https://wordpress.org/support/topic/tadv_settings-not-saving-properly-re-importcss/
-
Custom Styles doesn’t workhttps://wordpress.org/support/topic/custom-styles-doesnt-work/
-
Format/Custom Style Dropdown missinghttps://wordpress.org/support/topic/format-custom-style-dropdown-missing/
-
Format selectbox isnt populated with editor-style.csshttps://wordpress.org/support/topic/format-selectbox-isnt-populated-with-editor-stylecss/
-
CSS classes menuhttps://wordpress.org/support/topic/css-classes-menu/