Skip Navigation

This thread is resolved. Here is a description of the problem and solution.

Problem:
You want to set the WordPress Editor as the default and hide the WPML Editor choice from other users in the WordPress interface.

Solution:
You can use the following custom code to your active theme's functions.php file to hide the editor choice on the post edit screen for users who do not have 'manage_options' capability:

IMPORTANT: Please note that this is not an officially supported solution, but a proposed workaround to only suite this special need!

/**
 * Disable translation editor choice on post edit screens
 */
add_action( 'wpml_before_post_edit_translations_table', function() {
 
    if ( ! current_user_can( 'manage_options' ) )
    {       
        global $wp_filter;
         
        $hook_name = 'wpml_before_post_edit_translations_table';
        $priority  = 10;
         
        // Make sure this hook is defined and is a WP_Hook object
        if ( isset( $wp_filter[ $hook_name ] ) && is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
            $hook = $wp_filter[ $hook_name ];
             
            // If there are callbacks at this priority, remove them all
            if ( isset( $hook->callbacks[ $priority ] ) ) {
                unset( $hook->callbacks[ $priority ] );
            }
        }
    }
}, 1 );
 
add_action( 'wpml_before_post_edit_translations_summary', function() {
 
    if ( ! current_user_can( 'manage_options' ) )
    {       
        global $wp_filter;
         
        $hook_name = 'wpml_before_post_edit_translations_summary';
        $priority  = 10;
         
        // Make sure this hook is defined and is a WP_Hook object
        if ( isset( $wp_filter[ $hook_name ] ) && is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
            $hook = $wp_filter[ $hook_name ];
             
            // If there are callbacks at this priority, remove them all
            if ( isset( $hook->callbacks[ $priority ] ) ) {
                unset( $hook->callbacks[ $priority ] );
            }
        }
    }
}, 1 );

Please note, this code will remove the choice of editors from the post/page edit screen, specifically from the language section. Ensure you select your preferred editor before applying this code. Administrators will still have the choice available unless you modify the code to include them.

If this solution does not apply to your situation, or if it becomes outdated, we highly recommend checking related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If further assistance is needed, please open a new support ticket.

This is the technical support forum for WPML - the multilingual WordPress plugin.

Everyone can read, but only WPML clients can post here. WPML team is replying on the forum 6 days per week, 22 hours per day.

This topic contains 0 reply, has 0 voices.

Last updated by Waqas Bin Hasan 1 month, 3 weeks ago.

Assisted by: Waqas Bin Hasan.

Author Posts
March 11, 2025 at 9:23 am #16800282

tillB-3

Background of the issue:
I prefer using the WordPress Editor for translating content and want to set it as the default editor. I also want to hide the WPML Editor from other people editing content.

Symptoms:
There is no specific issue or error message mentioned.

Questions:
Is there any way to disable or hide the switch 'WPML Editor / WordPress Editor' from the WordPress interface?

March 12, 2025 at 6:59 am #16805117

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Hi,

Thank you for your patience and cooperation. I've escalated the matter to the relevant team and 'll get back to you as I've more information on it.

Regards.

April 9, 2025 at 6:28 am #16911489

Waqas Bin Hasan
WPML Supporter since 05/2014

Languages: English (English )

Timezone: Asia/Karachi (GMT+05:00)

Thank you for your patience and cooperation.

Our team has suggested the following code to hide editor choice on post edit screen:

/**
 * Disable translation editor choice on post edit screens
 */
add_action( 'wpml_before_post_edit_translations_table', function() {

	if ( ! current_user_can( 'manage_options' ) )
	{		
		global $wp_filter;
		
		$hook_name = 'wpml_before_post_edit_translations_table';
		$priority  = 10;
		
		// Make sure this hook is defined and is a WP_Hook object
		if ( isset( $wp_filter[ $hook_name ] ) && is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
			$hook = $wp_filter[ $hook_name ];
			
			// If there are callbacks at this priority, remove them all
			if ( isset( $hook->callbacks[ $priority ] ) ) {
				unset( $hook->callbacks[ $priority ] );
			}
		}
	}
}, 1 );

add_action( 'wpml_before_post_edit_translations_summary', function() {

	if ( ! current_user_can( 'manage_options' ) )
	{		
		global $wp_filter;
		
		$hook_name = 'wpml_before_post_edit_translations_summary';
		$priority  = 10;
		
		// Make sure this hook is defined and is a WP_Hook object
		if ( isset( $wp_filter[ $hook_name ] ) && is_a( $wp_filter[ $hook_name ], 'WP_Hook' ) ) {
			$hook = $wp_filter[ $hook_name ];
			
			// If there are callbacks at this priority, remove them all
			if ( isset( $hook->callbacks[ $priority ] ) ) {
				unset( $hook->callbacks[ $priority ] );
			}
		}
	}
}, 1 );

Please consider followings in terms of using this code:
- This is not an official implementation but a proposed workaround to your particular need.
- First edit any post or page in default language and in Language section, select the editor you want to use and chose the appropriate option (see attached). These options appear when you switch between editors from within post edit screen.
--- Please note that the above code 'll simply remove the choice of editors from post/page edit screen, from language section. So chose wisely, that which editor you want to continue using, either for the current post type or for entire site.
- Add this code to your active theme's functions.php file (at the end is a good place) and save.
--- By default administrator users 'll still have the choice of the editors.
--- If you'd want to disable the choice even for admins, comment out the following conditions in the code:

if ( ! current_user_can( 'manage_options' ) )
Screenshot 2025-04-09 111610.jpg