Hi @webmark487 ,
thanks for your message, it’s help. You can solve your issue adding this code on your website using code snippet or directly on your file (mu plugin, functions.php, …):
add_action('pre_get_posts', 'custom_weglot_translated_search_redirect');
function custom_weglot_translated_search_redirect() {
global $post;
if ($post) {
$post_status = get_post_status($post->ID);
if (!function_exists('weglot_get_original_language') || !function_exists('weglot_get_current_language')) {
return;
}
if (($post_status == 'draft' || $post_status == 'private') && !is_admin() && weglot_get_original_language() != weglot_get_current_language()) {
wp_redirect(weglot_get_full_url_no_language(), 301);
exit;
}
}
}
add_filter('weglot_button_html', 'custom_weglot_translated_search_no_selector');
function custom_weglot_translated_search_no_selector($button_html) {
global $post;
if ($post) {
$post_status = get_post_status($post->ID);
if (($post_status == 'draft' || $post_status == 'private') && !is_admin()) {
return '';
}
}
return $button_html;
}
Don’t hesitate if you need more help
Regards