Skip Navigation

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

Problem:
The client is unable to access the Translation Management feature in WPML, encountering a 404 error at /wp-admin/tm/menu/main.php and an access error at /wp-admin/admin.php?page=tm%2Fmenu%2Fmain.php. This issue is likely due to missing WPML capabilities in the user roles.
Solution:
1. Verify and restore the necessary WPML capabilities to the admin user roles. This can be done by checking the user capabilities in the wp_usermeta table and ensuring they include WPML specific capabilities. If they are missing, update the capabilities using the following code snippet in the functions.php file of your theme:

function add_wpml_caps_to_admin() {
    $role = get_role( 'administrator' );
 
    if ( $role ) {
        $capabilities = [
            'wpml_manage_translation_management',
            'wpml_manage_languages',
            'wpml_manage_theme_and_plugin_localization',
            'wpml_manage_support',
            'wpml_manage_woocommerce_multilingual',
            'wpml_operate_woocommerce_multilingual',
            'wpml_manage_media_translation',
            'wpml_manage_navigation',
            'wpml_manage_sticky_links',
            'wpml_manage_string_translation',
            'wpml_manage_translation_analytics',
            'wpml_manage_wp_menus_sync',
            'wpml_manage_taxonomy_translation',
            'wpml_manage_troubleshooting',
            'wpml_manage_translation_options',
            'manage_translations'
        ];
 
        foreach ( $capabilities as $cap ) {
            $role->add_cap( $cap );
        }
    }
}
add_action( 'admin_init', 'add_wpml_caps_to_admin' );

After applying this fix, refresh your admin panel. If the problem persists or if the solution provided here becomes outdated, we recommend checking related known issues at https://wpml.org/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 at WPML support forum.

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.

Tagged: 

This topic contains 4 replies, has 0 voices.

Last updated by Andreas W. 1 month ago.

Assisted by: Andreas W..

Author Posts
April 25, 2025 at 5:18 pm #16969545

Ivano

Background of the issue:
I am trying to access the Translation Management feature in WPML on my site hidden link. In my WPML, I can't find WPML -> Translation management. Instead, there is WPML -> WPML that links to /wp-admin/tm/menu/main.php, which results in a 404 Not Found error. I have the same situation as described in this ticket: https://wpml.org/forums/topic/we-cant-find-wpml-translation-management/. I tried using /wp-admin/admin.php?page=tm%2Fmenu%2Fmain.php and received 'Sorry, you are not allowed to access this page.' I have disabled all other plugins and only have WPML plugins active. I also switched to the Twenty Twenty-Five theme. I can provide access to my development site.

Symptoms:
404 Not Found error when accessing /wp-admin/tm/menu/main.php and 'Sorry, you are not allowed to access this page' when using /wp-admin/admin.php?page=tm%2Fmenu%2Fmain.php.

Questions:
Why can't I find WPML -> Translation management in my WPML?
How can I resolve the 404 Not Found error when accessing /wp-admin/tm/menu/main.php?
Why am I receiving 'Sorry, you are not allowed to access this page' when using /wp-admin/admin.php?page=tm%2Fmenu%2Fmain.php?

April 25, 2025 at 5:35 pm #16969589

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

Could you please try to delete the plugin and reinstall it?

You can download the plugin here:
https://wpml.org/download/wpml-multilingual-cms/?section=changelog

It this does not solve the issue, could you please create a new admin account and verify if the issue persists when being logged in to this new account?

Best regards
Andreas

April 26, 2025 at 8:12 am #16970437

Ivano

Hello,

I delete and reinstall the plugin, nothing change.

I logged in with a new admin account and the WPML menu changes but it seems not as expected (see screenshot).

Menu WPML -> Translation management is not visible.
I activate WPML String Translation plugin but menu WPML -> String translation is not visible.

I don't understand... Could you please have a look?

Thanks

Two different admin users.jpg
April 26, 2025 at 2:14 pm #16971025

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

It looks like your new account is not admin account.

Can you please change the user role to admin and then verify again?

This issue might be related to user capabilities and I would like to know if it is replicable with a newly created admin account.

April 26, 2025 at 3:58 pm #16971214

Ivano

I confirm you that the new account I created is an "administrator" role.
To be absolute sure I created another admin account and the result is the same.

April 26, 2025 at 4:29 pm #16971340

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Hello,

I would like to request temporary access (wp-admin and FTP) to the website to investigate the issue further. Please provide access to an admin account.

You can find the required fields below the comments section when you log in to leave the next reply. The information you provide is private, meaning only you and I can see and access it.

IMPORTANT
Please be sure to back up your website and database before granting us access.
If you can't see the "wp-admin / FTP" fields, your post and website credentials will be set to "PUBLIC." DO NOT publish the data unless you see the required wp-admin / FTP fields.

I may need to install a plugin called "All In One WP Migration" to create a copy of the website so I can investigate the issue further.

However, I would also be very grateful if you could provide a staging site or a copy of the website from your server for this purpose.

If you have any questions about creating such a staging site, you can consult your hosting provider. Please note that WPML must also be registered on this staging site at https://wpml.org/account/websites/.

If you are unable to provide such a copy of the website for testing, please let me know on this ticket.

The private reply form looks like this:
hidden link

Click "I still need assistance" the next time you reply.

Video:
hidden link

Please note that we are required to request this information individually on each ticket. We are not permitted to access any credentials that were not specifically submitted on this ticket using the private response form.

Best regards,
Andreas

April 26, 2025 at 7:55 pm #16971574

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I am not sure why, but in the user meta table all the admins are missing the WPML capabilities.

They should look like this:

Inside the meta key:

ptw_capabilities

It should say:

a:17:{s:13:"administrator";b:1;s:34:"wpml_manage_translation_management";b:1;s:21:"wpml_manage_languages";b:1;s:41:"wpml_manage_theme_and_plugin_localization";b:1;s:19:"wpml_manage_support";b:1;s:36:"wpml_manage_woocommerce_multilingual";b:1;s:37:"wpml_operate_woocommerce_multilingual";b:1;s:29:"wpml_manage_media_translation";b:1;s:22:"wpml_manage_navigation";b:1;s:24:"wpml_manage_sticky_links";b:1;s:30:"wpml_manage_string_translation";b:1;s:33:"wpml_manage_translation_analytics";b:1;s:25:"wpml_manage_wp_menus_sync";b:1;s:32:"wpml_manage_taxonomy_translation";b:1;s:27:"wpml_manage_troubleshooting";b:1;s:31:"wpml_manage_translation_options";b:1;s:9:"translate";b:1;}

I suspect that this is some side-effect of using plugins like "User Role Manager".

I would suggest you enable the admin role in "User Role Manager" and make sure that admins have all the necessary capabilities.

April 28, 2025 at 1:06 pm #16974931

Ivano

Hi Andreas,

I didn't found a solution.

I verified that in "User Role Manager" admins have full capabilities. For your info: I do not need this plugin, I installed it in the past but then I deactivated it.

In the user meta table there are no.3 admins (see screenshot) with the correct ptw_capabilities meta_value but also for this users the issue persists:
user_id=1
user_id=2
user_id=17 (your account)

Also, I don't understand why new account admin user are created with a wrong ptw_capabilities.

I've no idea how to solve this.

ptw_capabilities.jpg
April 29, 2025 at 5:05 pm #16980439

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

I fixed the issue manually now on your DB for all admin users.

Please follow this guide to reset the user role and remove the "User Role Editor" plugin in case you do not need it:

hidden link

If this will not solve the issue for new users, please let me know.

April 30, 2025 at 8:54 am #16982568

Ivano

Sorry but I need your help again.

I reset the users roles with "User Role Editor" plugin.

Reactivation of WooCommerce creates "Shop manager" and "Customer" user roles, that seems ok.

My issues now are:
1) new admin users has not wpml capabilities
2) "Translator" user role is missing. I tried some ways explained here hidden link without result.

All these steps I’ll have to do again in the Production site, so I need to know the manual fix on the db that you did in the previous step.

Thanks

April 30, 2025 at 10:00 am #16982919

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

The fix is explained here:
https://wpml.org/forums/topic/i-cant-find-wpml-translation-management/#post-16971574

Check your Users list ad Users > All Users in WordPress. If you hover of the name of each user you will see a URL in the left bottom corner of the browser which includes an ID.

Random Example:
hidden link

Here the user ID would be 1.

Take note of the IDs for your admin users.

Then go to the table wp_usermeta and search for the meta key: ptw_capabilities

Now make sure to change the meta value for each of you ID by considering the correct IDs.

They need to use this value:

a:17:{s:13:"administrator";b:1;s:34:"wpml_manage_translation_management";b:1;s:21:"wpml_manage_languages";b:1;s:41:"wpml_manage_theme_and_plugin_localization";b:1;s:19:"wpml_manage_support";b:1;s:36:"wpml_manage_woocommerce_multilingual";b:1;s:37:"wpml_operate_woocommerce_multilingual";b:1;s:29:"wpml_manage_media_translation";b:1;s:22:"wpml_manage_navigation";b:1;s:24:"wpml_manage_sticky_links";b:1;s:30:"wpml_manage_string_translation";b:1;s:33:"wpml_manage_translation_analytics";b:1;s:25:"wpml_manage_wp_menus_sync";b:1;s:32:"wpml_manage_taxonomy_translation";b:1;s:27:"wpml_manage_troubleshooting";b:1;s:31:"wpml_manage_translation_options";b:1;s:9:"translate";b:1;}

Now, that your site will still have issues creating new users with WPML capabilities and that you are missing the Translator User Role seems to be an issue caused by the User Role Editor plugin.

If you need further assistance, I can offer to consult the second-tier support about what might be causing this problem, but first, let us make sure that your site is functional.

If you need my help with applying the fix on the production site, please do not hesitate to ask.

April 30, 2025 at 12:16 pm #16983764

Ivano

Andreas, I thank you a lot.

I added ptw_capabilities to all admin users on db, they works.

I activated all plugins and Hello Child theme and I tested functionality of my site, it works.

Than, I deactivated all plugins and switched back to Twenty Twenty-Five theme.

Now:
1) new admin users still has not wpml capabilities
2) Translator user role exists (it appeared after I activate/deactivated all plugins)

I have the same situation on Production site (that's good), so now I need help to solve point 1).

Thanks!!

April 30, 2025 at 2:03 pm #16984338

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

This should be solveable like this:

We need to add the missing capabilities to the wp_user_roles meta key inside wp_options.

I added this snippet to the functions.php file of the theme:

function add_wpml_caps_to_admin() {
    $role = get_role( 'administrator' );

    if ( $role ) {
        $capabilities = [
            'wpml_manage_translation_management',
            'wpml_manage_languages',
            'wpml_manage_theme_and_plugin_localization',
            'wpml_manage_support',
            'wpml_manage_woocommerce_multilingual',
            'wpml_operate_woocommerce_multilingual',
            'wpml_manage_media_translation',
            'wpml_manage_navigation',
            'wpml_manage_sticky_links',
            'wpml_manage_string_translation',
            'wpml_manage_translation_analytics',
            'wpml_manage_wp_menus_sync',
            'wpml_manage_taxonomy_translation',
            'wpml_manage_troubleshooting',
            'wpml_manage_translation_options',
            'manage_translations'
        ];

        foreach ( $capabilities as $cap ) {
            $role->add_cap( $cap );
        }
    }
}
add_action( 'admin_init', 'add_wpml_caps_to_admin' );

This added the missing user role capabilities for admins to the WordPress User Roles option.

After adding this snippet and refreshing the backend you can remove the snippet again.

April 30, 2025 at 3:48 pm #16984859

Ivano

SOLVED!
Thanks Andreas!

Only if it was useful to someone else:
1) capabilities meta key in wp_options is wp_user_roles (not wp_user_rules)
2) after running add_wpml_caps_to_admin() the meta key ptw_capabilities in wp_usermeta fon new Admin users is a:1:{s:13:"administrator";b:1;} only, but they have full access to WMPL menu

Thanks again

April 30, 2025 at 3:53 pm #16984864

Andreas W.
WPML Supporter since 12/2018

Languages: English (English ) Spanish (Español ) German (Deutsch )

Timezone: America/Lima (GMT-05:00)

Thank you for your confirmation!

I am glad to hear that this is solved.