Remove WPML Admin Bar

User
admin bar shows some wpml transaltion in front end worpdress but we don't wan ttranslation
Assistant
If the WordPress admin bar is displaying WPML translation-related links or options on the frontend and you don’t want those to appear, you can remove them by customizing the admin bar. Here’s how to do it:

### 1. **Remove WPML Admin Bar Items**
Add the following code to your theme's `functions.php` file or a custom plugin:

add_action('admin_bar_menu', function ($wp_admin_bar) {
    // Remove WPML menu and submenus
    $wp_admin_bar->remove_node('WPML_ALS'); // WPML Language Switcher
    $wp_admin_bar->remove_node('wpml_menu'); // WPML Main Menu
}, 999);

This will target and remove the WPML-related items from the admin bar.

### 2. **Disable WPML Admin Bar Options**
If you’re not using the admin bar for WPML at all, you can disable it completely. Check WPML settings:

1. Go to **WPML > Languages**.
2. Look for an option related to **Admin Bar Language Switcher**.
3. Disable it, if available.

### 3. **Hide Admin Bar on Frontend for Specific Users**
If you don’t need the admin bar at all on the frontend for logged-in users, you can hide it entirely:

add_filter('show_admin_bar', function ($show_admin_bar) {
    // Disable admin bar on frontend
    if (!is_admin()) {
        return false;
    }
    return $show_admin_bar;
});

### 4. **Verify Cache Settings**
After making changes, clear your WordPress cache (if using a caching plugin) and browser cache to see the effects.

Let me know if you'd like more tailored help!

Leave a Comment

Your email address will not be published. Required fields are marked *