Answer the question
In order to leave comments, you need to log in
How to remove the language code for a specific page (polylang plugin)?
Hello! Googled, I found this code to solve this problem:
function filter_pll_check_canonical_url( $redirect_url, $language ) {
$redirect_url = str_replace('en', '', $redirect_url);
}
add_filter( 'pll_check_canonical_url', 'filter_pll_check_canonical_url', 10, 2 );
function filter_pll_check_canonical_url( $redirect_url, $language ) {
//если $redirect_url не пустой {
если $redirect_url == слугу моей страницы {
$redirect_url = str_replace('en', '', $redirect_url);
команда редиректа....
}
}
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question