• Hi!

    All of my pages are broken in my primary language. I mean I have the header and footer on pages but content is missing: https://ibb.co/3TdYzvT

    If I resave the permalinks the problem is gone but for only a few hours and later the problem is coming again.

    The good part that I can force the error to appear. This is how I force the error:

    – Go to Polylang -> URL modifications
    – Resave the setting here

    Thats all, after that the pages in primary language are gone again until I resave permalinks.

    Here is my settings on the URL modifications page in Polylang:
    https://ibb.co/GR4wpsg

    And I noticed even If I only change the active theme to another then I change it back to what it was, or just disabling any plugin and then immediately enabling the same plugin, still fixes the problem. Very very strange behaviour. Please fix it as I saw other people are struggling with similar problems here on the forum (they also say resaving permalinks fixes the problem for a time)

    Thanks,
    Peter

Viewing 11 replies - 1 through 11 (of 11 total)
  • Thread Starter peterforensys

    (@peterforensys)

    Any news about this bug? Can you at least confirm this bug or give me possible solutions?

    Looks like I have the same issue and only in default language.
    After last update of the plugin in default language I can see the content (page) part only on homepage. Other pages show me such message:
    “Nothing Found
    It seems we can’t find what you’re looking for. Perhaps searching can help.”
    If switch to another language this problem does not reproduce.
    Theme developer said that it’s Polylang issue.
    @peterforensys your temporary solution does not help for my website.

    Same problem.

    Thread Starter peterforensys

    (@peterforensys)

    @web13 we have very similar problem thats for sure. But for me my pages are blank and I don’t even get an 404 error like you. The blank pages have “200 OK” status codes for me.

    Anyway, I hope Polylang is looking into this asap.

    Thread Starter peterforensys

    (@peterforensys)

    After updating to PolyLang 3.4.4 the issue still exists ??

    Plugin Author Chouby

    (@chouby)

    Hello,

    Please check if you can reproduce the issue on a site with only a default theme and Polylang active. If that’s the case. Please open a GitHub issue with all the necessary steps to reproduce it from a fresh install.

    I have a similar issue; let me describe it. I have a website in both Czech and English languages, with Czech being the primary one. Pages in Czech language regularly lose their permalinks and return a 404 error. Articles are fine, and pages in the secondary language are also working correctly. When I regenerate the permalinks (by changing the permalink structure in settings, saving it, and then reverting back to the original structure and saving again), WordPress picks up the URLs, and the permalinks work. However, after some time, the pages in the primary language start returning 404 errors again, and WordPress forgets the permalink. I have a feeling that we might be facing the same issue.

    The articles are fine in both languages, and the pages in the secondary language work correctly as well. The problem occurs specifically with the pages in the primary language, which lose their permalinks and return a 404 error. I need to regenerate the permalinks to fix the issue.

    And yes, these are also pages that don’t have a corresponding copy in the other language. They stand alone without translation.

    In apache error log I see this:

    Warning: Attempt to read property “slug” on bool in?/wp-content/plugins/polylang/include/crud-terms.php?on line?197

    for now I hope to solve this problém with snippet, which regenerate permalinks every time when web goes to 404 error:

    function check_and_regenerate_permalink_on_404() {
    if (is_404()) {
    flush_rewrite_rules();
    }
    }
    add_action(‘template_redirect’, ‘check_and_regenerate_permalink_on_404’);

    Regenerate permalinks is only way how to solve the problem until its goes wrong again. So with this snippet I hope users will see the error only one time and than snippet regenerate permalinks. But its temporary solution for me. I think its problem of Polylang, because in the past was everything ok and nothing was changed on VPS or WordPress itself.

    Thread Starter peterforensys

    (@peterforensys)

    The problem for me that I don’t get 404. The pages are blank but it’s not because of 404 errors. Now I use this code to regenerate permalinks every hour so my site never goes down more than 1 hour:

    // Flush permalinks every hour
    add_action(‘my_hourly_event’, ‘do_this_hourly’);

    function my_activation() {
    if ( !wp_next_scheduled( ‘my_hourly_event’ ) ) {
    wp_schedule_event(time(), ‘hourly’, ‘my_hourly_event’);
    }
    }

    add_action(‘wp’, ‘my_activation’);

    function do_this_hourly( $hard = false ) {
    global $wp_rewrite;
    $wp_rewrite->flush_rules( $hard );
    }

    I added the code in Code Snippets plugin with PHP Snippet and Run everywhere settings.

    Thread Starter peterforensys

    (@peterforensys)

    @chouby Hello! In the meantime I figured out the conflict. I had time and I made a test site and I installed plugins on it one by one. In this way I figured out that Polylang is conflicting with VikBooking plugin.

    So to reproduce the problem you need to make these steps:
    – Install Polylang and VikBooking to a clean WordPress site
    – Go to languages, settings, URL modifications and press “save changes” there
    – Then if you go back to the front end you will see blank pages at least on one of the two languages (if you have two languages in polylang)

    The biggest problem I don’t see any error messages even though debugging is enabled on the site. I think I will write to VikBooking as well to look into this.

    Thanks,
    Peter

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Pages are broken in primary language, temporary solution: resaving permalinks’ is closed to new replies.