• Resolved rickclick

    (@rickclick)


    I get an error in google search console under “404 page not found” and “links redirects”. I have gone through the site and database but i can’t find any place that have entered the wrong url with /sv/sv/. Its the same for /en/en/. The main language don’t get any errors because it doesn’t use language slugs. I use Falang for Elementor.

    The only place i have found in the html that mentions /sv/sv/ is the following code from yoast plugin:

    </style><script type="application/ld+json" class="yoast-schema-graph">{"@context":"https://schema.org","@graph":[{"@type":["WebPage","AboutPage"],"@id":"https://sicar.fi/sv/sv/about/","url":"https://sicar.fi/sv/sv/about/","name":"Meist?","isPartOf":{"@id":"https://sicar.fi/#website"},"datePublished":"2017-08-16T08:50:13+00:00","dateModified":"2023-07-12T10:40:05+00:00","inLanguage":"sv-SE","potentialAction":[{"@type":"ReadAction","target":["https://sicar.fi/sv/about/"]}]}

    Everything is updated to the latest version. Also the translated sites does not get added to the Yoast sitemap. Maybe these problems are related?

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

Viewing 13 replies - 1 through 13 (of 13 total)
  • Plugin Author sbouey

    (@sbouey)

    Do you have this on front-page or on all page, in your site all seem to work normally.

    There are specific code in home url to be sure not to have double language slug, it was an update of the 1.3.13

    Stéphane

    Thread Starter rickclick

    (@rickclick)

    Yes the translations work normally and front end is fine but i get the errors in Google search console like i mentioned and the sitemap only includes the main language, not the translated sites like /sv/ and /en/

    Plugin Author sbouey

    (@sbouey)

    You have to build a site by language, can you post your sitemap ,

    what sitemap system do you use ?

    Stéphane

    Thread Starter rickclick

    (@rickclick)

    Sorry what do you mean by “build a site by language” ?

    I use Yoast to make the sitemap but they are only including the pages in the default language.

    https://sicar.fi/sitemap_index.xml

    Plugin Author sbouey

    (@sbouey)

    Hi,

    In your case with english by default without slug in the url for default language it’s

    https://sicar.fi/sitemap_index.xml for english

    https://sicar.fi/sv/sitemap_index.xml for swedish

    Stéphane

    Thread Starter rickclick

    (@rickclick)

    Thanks, i added the sitemap individually for the languages in google search console. And i added the /sv/sv/ urls to robots.txt under Disallow. But will google know that robots.txt in root is for the other languages even tho i added 3 different sitemaps in search console?

    Plugin Author sbouey

    (@sbouey)

    locally in the yoast code

    <script type=”application/ld+json” class=”yoast-schema-graph”>{“@context”: “https://schema.org&#8221;,
    “@graph”: [{
    “@type”: “CollectionPage”,”

    @id”: “https://localhost/falangw/fr/&#8221;,

    i don’t have this duplicate slug (fr is a translated language)

    I have to find a way to reproduce the problem to solve it.

    Locally my site with Yoast is not an elementor site , i see you use Falang for Elementor (lite version ?)

    Stéphane

    • This reply was modified 1 year, 8 months ago by sbouey.
    • This reply was modified 1 year, 8 months ago by sbouey.
    Thread Starter rickclick

    (@rickclick)

    Yes i use Elementor and falang, both lite version, with Astra theme. I have no idea what is causing this error, if you have some ideas what i can check or do, then i can do that.

    I tried to search for similar problems on google but its hard because google replaces the / in “/en/en/” with – or spaces so the search results are not accurate.

    Plugin Author sbouey

    (@sbouey)

    I have installed the yoast plugin on my Astra theme i have used for the video to explain how Falang for Elementor work and i can reproduce the problem

    "url": "https://localhost/falang_wordpress_1/es/es/",

    now i can reproduce the problem i can find a solution. but it’s strange it’s happen only with astra and elementor

    Stéphane

    Plugin Author sbouey

    (@sbouey)

    the problem is in the filter use for yoast

    wp-content/plugins/falang/src/Falang/Filter/Site/Yoast.php

    if you comment line 62 and 65 like this , it will work (just a workaround)

    if (isset($data[‘url’])){
    //$data[‘url’]=str_replace($home_default, $home_url,$data[‘url’]);
    }
    if (isset($data[‘@id’])){
    //$data[‘@id’]=str_replace($home_default, $home_url,$data[‘@id’]);
    }

    Stéphane

    Thread Starter rickclick

    (@rickclick)

    Thanks a lot! That was quick. Now it’s working again. I commented out lines 65 and 68, instead of 62. Don’t know why my file was different. But i will have to do the same thing next time i update Falang right?

    Compatibility issues between different themes and plugins will probably never end since they are always making changes.

    Plugin Author sbouey

    (@sbouey)

    I wil ltry to find why there are difference , i can of course check there are no 2 slug and remove 1. it’s a dirty workaround but works temporary.

    Thread Starter rickclick

    (@rickclick)

    Hehe better with a dirty workaround than not working at all! For me it’s ok because i know how to fix it but others might also have issues since yoast, elementor and astra are some of the most used plugins/theme in wordpress

Viewing 13 replies - 1 through 13 (of 13 total)
  • The topic ‘Double language slugs with yoast’ is closed to new replies.