Skip Navigation

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

Last updated by Lauren 2 years, 11 months ago.

Assigned support staff: Lauren.

Author Posts
February 12, 2019 at 10:49 am #3187923


I am trying to:
Copy the 'Primary Category' selection on a WooCommerce Product.

Link to a page where the issue can be seen:
hidden link (correct)
hidden link (incorrect)

The breadcrumb 'Imaging' should be copied across as the Primary Category but instead it is getting the 'Primary Products' category on the translated version - the URL however seems to be fine. I have set the meta key '_yoast_wpseo_primary_product_cat' to Copy and then re-updated the Primary Category but it is still not changing on the translated version.

I have followed the steps here to clear the caches etc: but that has not helped.

February 13, 2019 at 2:55 pm #3194801


Languages: English (English )

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

Thank you for contacting WPML support. I'll be happy to help you with this.

Did you try deleting and recreating the primary category? Also, did you translate the category in WooCommerce -> WooCOmmerce Multilingual -> Categories?

Please also update to our latest version. Then, please try increasing the WP Memory Limit. Minimum requirements are 128Mb:

You can add this to wp-config.php to increase WP memory:

/** Memory Limit */
define('WP_MEMORY_LIMIT', '256M');
define( 'WP_MAX_MEMORY_LIMIT', '256M' );

Add it above the line /* That's all, stop editing! Happy blogging. */

February 14, 2019 at 9:04 am #3198300


Hi Lauren

Removing the categories is not an option at this stage of development I'm afraid. However, the translation of the category string is not the issue. All the category translations are fine and appearing correctly, the issue is that it is not picking up the correct term from the product_cat taxonomy.

Let me try to explain a bit more... I have the following category Structure:

Primary Products | ID: 2569
- Primärprodukte | ID: 2570 (Translated to DE)
Imaging | ID: 493
- Bildgebung | ID: 1449 (Translated to DE)

I have a product which is assigned to both 'Primary Products' and 'Imaging', and then I have set the Primary Category via Yoast to 'Imaging'. The field _yoast_wpseo_primary_product_cat is assigned as 493 (Correct).

I then have a DE Translated version of this post. I want the Primary Category to be Bildgebung, but the field _yoast_wpseo_primary_product_cat on the DE product is also assigned as 493 (Incorrect) as opposed to 1449 (Correct). On the frontend, this appears as Primärprodukte as it is not recognising the ID of the Primary Category.

So, is this the correct behaviour from WPML, or should be assigning the translated ID to the field?

If I change this field manually in the database to 1449 then the breadcrumbs work correctly. If this is working how you would expect then I would assume that this is an issue with Yoast SEO?

Please let me know if you need any more info.

February 14, 2019 at 1:17 pm #3199942


Languages: English (English )

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

Thanks for further explanation. It may be that this setting is stored in the admin texts, and we can translate the ID via string translation. To check this, please go to WPML > String Translation and scroll down to the bottom of the page and click on the link "Translate texts in admin screens »". Then, scroll through that page and see if you find the the string. If so, tick the checkbox and click Apply to add it to the String Translation table. Now you can go back to WPML > String Translation and you should see the string added there.