[Resolved] translated product category shows 404 not found
This thread is resolved. Here is a description of the problem and solution.
Problem: In a WooCommerce shop with multiple languages, the 'product-category' slug was translated for different languages. However, for the German language, setting the slug to 'produkte' results in a 404 error when visiting the page. The backend shows the Dutch translation instead.
Solution: We analyzed the issue and determined it is not directly related to WPML or WooCommerce, but rather to the permalink structure used. WordPress uses specific rules to determine what content to display based on the URL visited. If both single products and product categories share a similar permalink base (e.g., site.com/products/), WordPress may struggle to differentiate between product requests and product category archive requests, leading to errors like the one experienced. We recommend changing the permalink structure so that products and product categories do not use the same base. For example, use 'products' for the product category base and '/product/%product_cat%/' for the custom product base. This adjustment should resolve the issue.
If this solution does not apply to your case, or if it seems outdated, we highly 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 the problem persists, please open a new support ticket at WPML support forum 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.
Reference to our recent chat, please try the following:
1) Take a full backup of your site and database before proceeding.
2) Deactivate all plugins except WPML, WCML and WooCommerce.
3) Switch to a standard theme like 2024.
4) Check for the issue if it still happens.
5) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
6) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.
And let me know your findings and I'll try my best to help you further on the matter.
I need to take a closer look at your site. So I request temporary access (WP-Admin and FTP), preferably to a test site where the problem has been replicated.
Your next answer will be private, to share this information safely.
Also provide detailed steps to reproduce the issue and links to pages in admin and on frontend.
IMPORTANT: Please take a complete backup of the site to avoid data loss. I may need to activate/deactivate plugins also.
I was able to analyze issue in detail and in fact this isn't an issue but a matter of understanding.
In WooCommerce, you can not have duplicate base-slugs (see attached images highlighted with Red). Your shop page, category base, attributes base and product permalinks base has the same slug and this 'll always create problem.
So I've demonstrated this by using unique (or different) slugs (attached images highlighted in Green) and now these work just fine.
In short, if you go to WooCommerce -> WooCommerce Multilingual & Multicurrency -> Store URLs, the each slug under "Original Slug" column should be unique or different. And then should be translated accordingly.
Looks like there may be a caching issue or a conflict. I'll recommend to try the following:
1) Take a full backup of your site and database before proceeding.
2) Deactivate all plugins except WPML, WCML and WooCommerce.
3) Switch to a standard theme like 2024.
4) Clear all caches and check for the issue if it still happens.
5) Then start activating plugins one by one while keep checking for the issue. This way you 'll be able to pinpoint a conflict when & where it starts creating the problem.
6) If after activating all plugins you see that it still works fine, then switch to your theme and see if that's causing it.
I understand this is a live site and above mentioned might be a concern. In this case, it is recommended to clone the site on a staging/dev site first and check as mentioned above.
I am kinda out of patience with this. You guys always tell the same little story to deactivate stuff etc.
Can you please take a real look?
If you logged in, there is no caching.
So somehow on the German language: hidden link this works (wich is the Dutch slug) Wich i have NOT set up like this. Also this URL shows up on the BACKEND when viewing the WC categories, WHY?
On the front end (in the menus) it's like this: hidden link (correct German slug), but gives 404.
I can make a new duplicate for you to take a look.