Plugin WooCommerce: Translate Product URLs
By default, Weglot doesn't allow you to translate product URL, you can do it following this
add_filter( 'weglot_url_translate_metabox_post_type_exclude', 'custom_weglot_metabox_exclude' );
function custom_weglot_metabox_exclude( $excluded ) {
$excluded[] = 'product';
return $excluded;
}add_filter( 'weglot_url_translate_metabox_post_type_exclude', 'custom_weglot_metabox_include' );
function custom_weglot_metabox_include( $excluded ) {
$index = array_search( 'shop_coupon', $excluded, true );
if ( $index !== false ) {
unset( $excluded[ $index ] );
}
return $excluded;
}PreviousPlugin Woocommerce: Translate all email sent to customersNextUse custom language code (URL, lang and hreflang attribute)
Last updated