Support » Plugin: Multisite Language Switcher » Is it possible to set x-default when using Multisite language switcher?

  • Hello,

    I have my site in three languages:

    I would like to set an x-default for

    Is there any possibility to do that? I could not find any possibility to do that yet.

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

Viewing 8 replies - 1 through 8 (of 8 total)
  • Plugin Author Dennis Ploetner


    The x-default for a page is the page itself if there are no translations available. At least as far I understood it… MSLS does that already

    Do you mean a canonical link?

    Thread Starter leguanx



    thank you for your reply.

    I read that with the x-default I can indicate which page is the default page if there is no page in the language of the user. In the case of a french user for example I would like to indicate that is the default page. Correct me if I am wrong I do have only a superficial understanding of this topic.

    In my header I found the following code which I believe is set by the Multisite Language Switcher
    <link rel=”alternate” hreflang=”de” href=”; title=”DE ” />
    <link rel=”alternate” hreflang=”en” href=”; title=”EN ” />
    <link rel=”alternate” hreflang=”es” href=”; title=”ES” />

    In order to set the x-default for my English page, I need to change the hreflang to: hreflang=”x-default”

    I tried to do this via FTP access in the header.php and with the plugin Header, Footer and Post Injections, but it did not work.

    Thus either I am missing any detail (which is possible as this is very difficult for me) or I have to do it at a different place because I am using the Multisite Language Switcher.

    I’d appreciate any hint or advise with this issue.

    Plugin Author Dennis Ploetner


    I’m sorry but it is not implemented in MSLS as you would like. Right now, you have an x-default when no translation available


    and the other ones when a translation is in place:


    Thread Starter leguanx


    Thank you a lot for the information. That is great to know.

    I’m also needing this at the moment, I will integrate the x-default manually via filter then.

    But maybe it’s a good idea for a future update, to add a checkbox in the language settings screen, where you can set a specific language version as x-default and then this tag will automatically getting outputted besides the normal hreflang tag 🙂

    Is it possible to use this action to add the x-default?

    By saying if $blog->get_language() == “<my needed language”) and adding an additional link alternate tag? But how do I get the current url in this action? Wasn’t able to find it in the $blog variable at all, is it possible to access it inside this action?

    Plugin Author Dennis Ploetner


    Yiu need probably additional logic inside the Mslsoutput class … PRs are welcome.



    Hi Dennis

    According to ahrefs “Missing x-default” in every page I use Multisite Language Switcher.

    Are you planning to have an option in the plugin?

Viewing 8 replies - 1 through 8 (of 8 total)
  • The topic ‘Is it possible to set x-default when using Multisite language switcher?’ is closed to new replies.