Remove the from_store link when changing store views/languages in Magento

By default, on the store views list (usually for languages), Magento creates links to the different views but it also adds the “from_store” parameter. It seems that SEO guys don’t like this too much.

If you need to remove it, search on your theme templates for the “select_language” string. Usually, this is on the header.phtml, but depending on the theme, it can be placed in other places. So you can look for it using grep:

cd var/app/design/frontend #go to the theme folder

grep -r "select_language" ./

You’ll find you phtml with this string. Close to that string you’ll find the function: $_lang->getCurrentUrl(), change it to: $_lang->getCurrentUrl(false).

Note: Indeed, you can look for this function direcly, but try to not modify core files (including core themes).

That’s all!

2 comments

    • Michael on July 6, 2012 at 12:34 am

    Reply

    Thank you, this is such a great tweak!

    For me on EE 1.11.2.0 the file was in /MY_TEMPLATE/template/page/switch/languages.phtml and the line was:

    <a href="getCurrentUrl() ?>”>htmlEscape($_lang->getName()) ?>

    • Steve on March 14, 2013 at 9:53 am

    Reply

    Okay from_store is gone but I stll get ?___store=”xxx”.
    How can I remoe this too?

Leave a Reply

Your email address will not be published.