• Resolved mcdeth

    (@mcdeth)


    Hi, when translating taxonomy, new slug is auto generated. I strip cat/tax base with rank math so it might lead to duplicates. A workaround is to append either random id at the end or post/tax etc. slug. I noticed slugs are generated with wpml_generate_term_slug. Is it somehow possible to modify default logic? Google yielded no results. Thanks

Viewing 2 replies - 1 through 2 (of 2 total)
  • Plugin Support Nicolas V.

    (@nicolasviallet)

    Hi there,

    WPML will auto-generate the slug only if the slug field is empty when translating taxonomies in WPML > Taxonomy Translation. The wpml_generate_term_slug action relies on WordPress core functions to create a unique slug within the same taxonomy.

    In your case, it sounds like the duplicates may come from a different content type (e.g., pages), and because you’ve removed the taxonomy base, WordPress might have trouble resolving the correct URL on the frontend (for example, domain.com/shoes could point to either a page about shoes or a product category named “shoes”).

    This is a known issue when removing bases, as it can lead to URL conflicts/duplication. The best approach is to make sure slugs are unique across all content.

    I wouldn’t recommend modifying wpml_generate_term_slug directly. Instead, you can look at WordPress core functions and filters such as pre_term_slug or wp_unique_term_slug to build a custom slug. I’d also suggest using understandable prefixes/suffixes rather than random IDs, to create user-firendly and SEO-friendly URLs.

    Last, please note that the issue is related to translations (WPML), so feel free to open a ticket on our support forum, as WordPress.org has a no commercial plugin policy.

    Thread Starter mcdeth

    (@mcdeth)

    Thank you Nicolas

Viewing 2 replies - 1 through 2 (of 2 total)

The topic ‘wpml_generate_term_slug’ is closed to new replies.