Visual editor not loading on a site loaded through Cloudfront or other proxy services

If your site sits behind a proxy service such as Cloudfront, you may find the Visual editor of TinyMCE is not available.


WordPress uses information about a visitor’s user agent to determine whether their browser can support the visual editor. In some cases, this information may not be present or accurate, for example if requests are proxied through Cloudfront. This will result in the Visual and Text tabs being missing from any TinyMCE editors on your site with no option to access the standard visual editor.

In these cases, you can force the user_can_richedit filter to always return true in order to ensure all admin users have access to the Visual editor. Add the following function, linked to WordPress’ init hook, to your functions.php file or equivalent.

function enable_richedit_cloudfront () {
    add_filter('user_can_richedit','__return_true');
}

add_action( 'init', 'enable_richedit_cloudfront', 9 );

You should now be able to access the Visual editor of TinyMCE in the usual way.

A lightweight, intuitive WordPress theme to enable flexible developement.

  • Lighting-fast installer
  • Intuitive SASS structure
  • Bloat-free

Build with Barebones