Force Removal of Store Code (?___store=default) from URL’s in Magento

Geoff Jackson

Geoff Jackson (more commonly known by his online pseudonym zigojacko) is the founder of Design Haven and The Clubnet Group which hosts numerous agencies including the most widely recognised of them, Clubnet Digital, a full service digital marketing and creative design/development agency. He also has a personal blog but it doesn't get updated as much as he'd like.

You may also like...

Sponsored Links...

Subscribe to Design Haven UK

Enter your email address to subscribe and receive our new posts by email.

26 Responses

  1. renish khuntq says:

    not working. please help.

    • How is it not working Renish?

      • What version of Magento are you on?
      • Do you get an error message at all (or does anything break)?
      • Does the URL change at all after making the change?
      • Have you cleared cache after making change?
  2. Eddie says:

    Worked perfectly for me on 1.7.02.

  3. Shirakat says:

    Thanks for the info, but it doenst work for me…
    I have magento, your solution dont break anything, just i get the /?___from_store=en like before i touched the code.

    What am i doing wrong?

    Thanks for your help!!

    • Sorry to hear it hasn’t worked for you Shirakat.

      Can you double check you have the correct path replicated in your local code pool?

      It has to be exactly like below otherwise it won’t extend the core Mage file and no change will take affect…


      Failing that, have you tried clearing your cache and reindexing in Magento?

  4. Center says:

    Worked perfectly for me on

    Actually, you have to set ‘add store code to URL’s’ set in Magento’s system configuration set to ‘YES’,

    NO = add ?___store=default for all switches
    YES adds the store code into every URL

    magento gui also says “IN URLS”
    “Warning! When using Store Code in URLs, in some cases system may not work properly if URLs without Store Codes are specified in the third party services (e.g. PayPal etc.).”

    • Thanks for your comment Center.

      When ‘Add Store Code to Urls’ is set to ‘Yes’, it adds an extra path into the URL with the store code, like:-

      When this is set to ‘No’, it’s like:-

      It doesn’t actually affect the appended switch parameter to the URL.

  5. Sergey says:

    Hello! Please tell me how to do it for magento 1.9?

  6. Sergey says:

    Unfortunately did not work …:-(I did not have the folder “local”. I created it and put it in the folder as you have written. app/code/local/Mage/Catalog/Block/Widget/Link.php In this file, replace the line.

    • Yes, you will need to replicate the path in your ‘local’ code pool if it doesn’t already exist. Feel free to share the URL of where this is problem is apparent if you’re still having an issue.

  7. Sergey says:

    I created a folder, as you have written. Here’s shop where I train.:-)

    • Hey Sergey, where on your store can we find a URL with ?___store=default? I couldn’t see any, does this mean you managed to resolve the problem in the end?

  8. Sergey says:

    Please help, I can not find a solution …

  9. Jackey says:

    Perfect solution! It works like a charm! Thank you! Do you want to create a module instead? I really hate Mage override (only for temporary approach)

    • Hey Jackey, it would be a good idea to package this as a small extension and extend the class properly. It’s unlikely I will get a chance to look at this in the next month or two though as I am so busy but will try and pick this back up again later down the line (feel free to remind me). Thanks.

  10. Yechiel says:

    Hello, i need help.

    its not working for me.

    i have 3 language on the website:

    Hebrew (default), English and Arabic.

    actually i need the default url will show without store code, but for the “en” and for the “ar” that will show the code store, because i want to create “sitemap” for each store, and also with code store i have the option to redirect the customers for the specific language they need.

    do you have any solution for me?


    • Hey Yechiel, sorry for such a delayed reply.

      Magento uses this URL parameter for switching between languages, are you wanting to remove the parameter that looks like this &___from_store=default from your URL’s?

      There is an extra step for working with the URL parameters when serving your website content in multiple languages in Magento.

      Looking at your website, you managed to resolve it?

      I can post a follow up to this with the extra steps for languages too.

      • Kay says:

        Hey Geoff, it would be great to read the follow up you offered/mentioned in your above reply. I`m using the language switcher and trying to get the ?___store=default removed. But, even after hours of try and error, i can`t solve it. So, i`d like to read your suggestion.

  11. Eddie says:


    Thanks for this – worked on CE

    Best wishes,


  12. Baby in magnto says:

    hi, this solution did’t worked for me for site time when i opened the site in browser, but in 2nd time, its working fine. we are using this module : once i disable the module, its working fine.

  13. Baby in magnto says:

    hi, this solution did’t worked for me for first time.  we are using this module : once i disable the module, its working fine.

  14. Viswa says:


    It did not work for me.

    I created the file and changed as suggested.


    When I changed the file, My store View was set to Japnese by default, now it is coming as English.


    Can you suggest me, what to correct?

Leave a Reply

Your email address will not be published.

This site uses Akismet to reduce spam. Learn how your comment data is processed.

%d bloggers like this: