• Resolved Pierre

    (@ierpe)


    Hi,

    I am having two problems between WPML and your plugin.

    First, the canonical tag between the pages /home/ and /en/home/ had a problem.
    It was always showing the default version (fr), even on the EN page. Maybe because it’s the same slug ?

    I quick fixed it using :

    add_filter('the_seo_framework_rel_canonical_output', function ($url, $id) {
      if (basename(get_permalink()) == "home" and "en" == apply_filters('wpml_current_language', NULL)) {
        $url = home_url() . 'home';
      }
      return $url;
    }, 10, 2);
    

    But it’s not great…

    Second problem with the schema.org structured data. It seems it’s always showing the default language (here it’s FR), even on EN pages.

    Do you know how I could fix it?

    Kind regards

    The page I need help with: [log in to see the link]

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    After some inspection, I found that there’s a URL-modification plugin active on the site. This plugin seems to be the root of various issues on your website.

    For example, look at any English non-homepage’s HTML source code, and you’ll find that the hreflang tags on top have broken links. I believe that the homepage URLs (and all other broken URLs) will be rectified once that plugin is disabled.

    I’m foregoing the Schema.org issue for now, because I’m not sure if that’s a related issue. Feel free to follow up ??

    Thread Starter Pierre

    (@ierpe)

    Hi and thanks for your response.

    I found that a configuration of the Soil plugin was creating some problems (We are using the Roots Bedrock WP stack). After removing the relative URLs configuration of this plugin, it fixed some things.
    It fixed the hreflang problems, not sure if you identified other problems.

    But I still have the aforementioned canonical url problem between /home and /en/home, and the generated Breadcrumb schema data is still pulling some french content, even though the SEO data is filled with english content :

    <script type="application/ld+json">{"@context":"https://schema.org","@type":"BreadcrumbList","itemListElement":[{"@type":"ListItem","position":1,"item":{"@id":"https://thesite.com/en/","name":"<strong>Conseil en optimisation du transport</strong>"}},{"@type":"ListItem","position":2,"item":{"@id":"https://thesite.com/en/home/","name":"Optimisation consulting of goods transport"}}]}</script>

    Where does the french “name” come from ?

    Screenshots :

    https://ibb.co/ctzK5Yt
    https://ibb.co/Kq9kXxv

    Plugin Author Sybre Waaijer

    (@cybr)

    Hello!

    The URLs now look good to me on the front-end, even the /en/home one.

    The breadcrumbs lead to the root page of your site–that’d be / for French and /en/ for English. The script parser takes the title of that page to name it, so you may want to look into adjusting the title settings for the root page(s) to correct them.

    If you’re encountering other issues, you may find that toggling this setting will fix them: “WPML > Languages > Make themes work multilingual > Adjust IDs for multilingual functionality”. I recommend checking that, even at the cost of performance overhead.

    Thread Starter Pierre

    (@ierpe)

    The EN canonical works only because of the quick fix I added (code in my first message). If I comment it, the canonical is still wrong. The quick fix is ok for me, but there might still be a bug somewhere…

    For the WPML option, it’s already on.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘WPML problems’ is closed to new replies.