So, i installed Polylang and the problem I am facing is related to the post preview function on my WordPress website. When I preview a post on different language than default, it takes me to a 404 error page unless I manually change the domain from the current one to the ".cz" domain. (I'm using different TLD for every language). I want to find a solution that will allow the post preview function to work properly with the Polylang plugin with every language.

All updates are installed, everything is up to date.

Thank you!

1 Answer 1


I know that i'm 2 late, but i had the same problem. I rewrote the urls to ignore polylang functionality like this:

if ( (isset($_GET['page_id'])) || (isset($_GET['preview']) && $_GET['preview'] === 'true') ) {
    $query->query_vars['pagename'] = '';

The problem is that the polylang adds /{new-language}/ to the url, but WP treats it as a page. This function ignores this and essentially solves the problem

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.