I've tried most of the solutions to remove "?___store=default" from magento URL but no success.

that makes duplicates for every page on magento (1.9.4) site that effecting SEO.

is there a working solution for this issue?

  • Magento 1.9.4 is not out yet. Do you mean Magento
    – toon81
    Commented Apr 17, 2018 at 11:40

4 Answers 4


The parameter is necessary if multiple store views have the same base URL because to distinguish on what store view you are, a cookie must be used. This cookie is set based on the ___store URL parameter.

If your store views have different base URLs (like different domains or subdirectories, also possible with the configuration Add Store Code To URLs), you could try to set up a 301 redirect using .htaccess that redirects these URLs to the same URL without ___store parameter.

But there is a caveat: you absolutely need the __from_store parameter if you use different URL keys in different store views. It is used to look up the URL path in this store to find the product or category, then redirect to the URL in the selected store. On product and category pages, this is not a SEO issue, because of the redirect, but on other pages it does nothing and if you remove ___from_store from all URLs, the redirect won't work anymore.

An alternative is to implement what Magento Enterprise does out of the box (I can't give code details for obvious reasons):

A predispatch observer that looks for the ___store and ___from_store parameters, figures out what's the right URL and redirects while setting the store cookie.


In System -> Configuration -> Web -> URL Options the first item is 'Add Shop Code to URLs'. That will be set to 'No' by default. Of course, anyone seeing this will assume that having that set to 'No' means that the '?___store=' part shouldn't be appended to the url, but the opposite is the case. That parameter is used by Magento to display the correct store because it’s set to 'No', not in spite of it.

  • You should mention that setting this configuration to "Yes" results in URLs like example.com/de where de is the store code (i.e. the store code is always part of the base url). It's true that as a side effect it also removes the ___store parameter because it is not necessary anymore. Commented Jul 25, 2016 at 18:48
  • I'm using a single store so why is that required? also when I enabled that option my site return 404 error Commented Jul 25, 2016 at 18:54

You don't need to do anything about such URL. Instead, you login your Google Webmaster and go to the section "URL parameters". In this section you can add the ?___store parameter and let Google know that it doesn't affect page content.


If, like us, you already have these URLs indexed by Google, you should exclude them in URL parameters, ensure you have a canonical URL tag and then you could also intercept the request in something like index.php and 301 it to a page without the unwanted params:

$url = parse_url($_SERVER['REQUEST_URI']);
if (!empty($url['query'])) {

    //$params = arrary();
    $checkingfor = array('___store', '___from_store');
    parse_str($url['query'], $params);
    if (count(array_intersect_key(array_flip($checkingfor), $params)) > 0) {
        $vars = array_diff_key($params, array_flip($checkingfor));
        $finalUrl = http_build_url(
                "scheme" => $_SERVER['REQUEST_SCHEME'],
                "host" => $_SERVER['SERVER_NAME'],
                "path" => $url['path'],
                "query" => http_build_query($vars)
        header('Location: ' . $finalUrl, true, 301);

If you don't have PECL installed, use this alternative to http_build_url().

Originally posted here.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.