Skip Navigation

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

Problem:
If you're experiencing 404 errors on category taxonomy pages in languages other than the main language, and you've already tried increasing the WP Memory Limit, deactivating plugins, switching themes, and resetting permalinks without success, the issue might be related to the way your custom taxonomies are set up.

Solution:
First, ensure that you're using a string literal for the text domain in your localization functions, rather than a constant. This is important for parsing tools to correctly differentiate between text domains. Here's an example of what you should avoid:

__( 'Translate me.', $text_domain );

Next, we recommend downloading the Toolset Types plugin from your WPML account and creating a test custom taxonomy to see if the issue persists. This can help determine if there's a mistake in your current custom taxonomy setup. You can download the plugin from your WPML account downloads page.

If these steps do not resolve the issue, it's possible that the solution provided here might be outdated or not applicable to your specific case. We highly recommend checking the related known issues, verifying the version of the permanent fix, and confirming that you have installed the latest versions of themes and plugins. If the problem persists, please do not hesitate to open a new support ticket with us for further assistance.

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 5 replies, has 2 voices.

Last updated by Andrey 1 year, 1 month ago.

Assisted by: Andrey.

Author Posts
March 15, 2024 at 8:40 pm #15416042

volodymyrG-2

Hello!
I have 3 languages in my WEB-site Ukrainian, Eanglish, Russian
Main - Ukrainian
I have 404 errors in category taxonomy pages. So, I have taxonomy "estate_objects" - And I have categories of this taxonomy:
Estate Built objects
Estate category
Estate type
Estate city-district
Estate compatible with

When Ukrainian lang all is ok - hidden link
When the others languages and I try to see category - I have en error 404 - hidden link

I contacted you earlier today and received troubleshooting instructions from your support service team:
Can you please try the following?

IMPORTANT: Take full backup of your website and database beforehand. It is highly advised to try the following on a staging/dev site first, so your live website isn't compromised.

- Fix “WP Memory Limit” to at least 128MB while 256MB is recommended. See https://wpml.org/home/minimum-requirements/ for detailed information. You can set this in your wp-config.php file by adding following code:

define( 'WP_MEMORY_LIMIT', '128M' );
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Remember to add these lines before the line where it says:
/* That's all, stop editing! Happy publishing. */

- Deactivate all plugins except WPML and its addons and check for the issue.
- Switch to a standard WordPress theme like 2021 or 2024 and recheck.
- Activate each plugin one-by-one, while keeping check on the issue after a plugin is activated. This way you'll be able to pinpoint a plugin having a conflict (or problem), if any.

I did everything as your support person suggested. I disabled all plugins - increased the amount of memory in wp-config.php - switched the theme to the standard one, and then to my own - but this did not help
But what I found, I found that the problem occurs when switching Permalinks in the settings
When rebooting permalinks (Settings --> Permalinks --> Save Changes) in a certain language, one of the languages starts working, but in another language the translations stop being displayed
Please watch the video it illustrate the current problem - hidden link

March 15, 2024 at 9:56 pm #15416079

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thank you for reaching out to WPML support.

To clarify, am I correct in understanding that you are experiencing the same issue with any default theme? Also, please describe how you created the "estate_objects" taxonomy.

To troubleshoot the problem further, I suggest temporarily turning off the WPML String Translation plugin but leaving the WPML Multilingual CMS plugin enalbed.

Please let me know the outcome of this test.

March 16, 2024 at 9:38 pm #15417447

volodymyrG-2

I can't do this with any other themes, as my "estate_objects" taxonomy is built into the theme - it's in my theme in functions.php (see image)
$estateCategory = new Taxonomy('estate_objects', 'estate');
$estateCategory->setLabels([
'name' => __('Estate Built objects',TEXTDOMAIN,)
]);
$estateCategory->uses($estate);

If anything, this is happening with all my other taxonomies

I just won't be able to test the taxonomy in another topic, since it won't be there. Or do you mean add this taxonomy to another topic?

I also show you the translation settings for the 'estate_objects' taxonomy in the video
Also doing as you advised "disabling WPML String Translation " in the video hidden link.

Disabling WPML String Translation did not help
Thank you I look forward to your reply!

Снимок экрана 2024-03-16 210745.png
March 18, 2024 at 8:36 am #15419549

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thanks for sharing your feedback along with the screencast. Are the functions you mentioned custom-built or part of a commercial theme that includes those taxonomies? Have you tried checking this issue with default taxonomies like Category?

March 19, 2024 at 9:29 pm #15428924

volodymyrG-2

This theme is a custom, non-commercial theme that was modified by me, adding the necessary taxonomies and functions.
Indeed, I checked the standard post categories - in the standard post categories the translations work well, as usual - hidden link
This can be seen in the video.
Can you please tell me that WPML works with custom taxonomies?
How can I solve my problem?

March 20, 2024 at 6:43 pm #15433445

Andrey
WPML Supporter since 06/2013

Languages: English (English ) Russian (Русский )

Timezone: Europe/Kyiv (GMT+03:00)

Thanks for the update. WPML works well with custom taxonomies. My best guess is that there is some tiny mistake in the code. To check this, I suggest you download our plugin Toolset Types from your account https://wpml.org/account/downloads/, create a test custom taxonomy with it, and test it.

I already noticed one thing in your screenshot: the use of the TEXTDOMAIN constant in your code. Instead of a constant, you should have an actual domain name.

https://developer.wordpress.org/themes/functionality/internationalization/

The text domain should be passed as a string to the localization functions instead of a variable. It allows parsing tools to differentiate between text domains. Example of what not to do: __( 'Translate me.' , $text_domain );

Let me know how it goes.