How to remove Magento Orders and Returns Page

How to remove Magento Orders and Returns Page

July 29, 2026 · Illustrated author avatarBy Stefan Bogdanescu
How to remove Magento Orders and Returns Page

Removing Unwanted Magento Pages Permanently: The Orders and Returns Example

As an experienced developer working with Magento platforms, you’ve likely come across unwanted pages that appear by default but don’t align with your site’s layout or SEO strategy. One common culprit is the “Orders and Returns” page introduced in Magento versions 1.6 and later.

Understanding the Default Behavior

By default, Magento creates an Orders and Returns page at the URL structure www.yourstore.com/sales/guest/form/. This page allows guest users to view their order history. However, many stores prefer to manage returns through a dedicated system or custom functionality rather than this built-in feature.

Moreover, if not properly managed, this page can be indexed by search engines like Google, potentially leading to duplicate content issues and confusing navigation for customers.

The first step is to remove the link to this page from your site’s footer. This is a straightforward process involving layout updates in your local.xml file.

Here’s how you can do it:

  1. Navigate to your app/design/frontend/<your_package>/<your_theme>/layout/ directory.
  2. Open or create a local.xml file if one doesn’t exist.
  3. Add the following code inside the <layout> tags:
<default>
    <reference name="footer_links">
        <action method="removeLink" link_id="guest_order_history"></action>
    </reference>
</default>

This XML snippet removes the “Guest order history” link from your footer.

Removing the Page Itself: A More Advanced Approach

While removing the link hides the page from users, it doesn’t prevent the page from being created or indexed. To completely remove this functionality, you need to override or disable the core Magento modules responsible for creating these pages.

Overriding the Controller

The Orders and Returns page is generated by a controller action in the Mage_Sales module. You can override this controller to prevent it from executing.

  1. Create a new folder named app/code/local/Mage/Sales/controllers/.

  2. Inside this folder, create another folder named Guest.

  3. Copy or clone the existing GuestController.php file located in app/code/core/Mage/Sales/controllers/Guest/ and paste it into your newly created folders.

  4. Open the new GuestController.php file and add a line of code at the beginning of the _construct() method:

public function _construct()
{
    $this->_redirect('*');
}

This code redirects all requests to any URL in your site, effectively preventing the GuestController from executing.

  1. Save the changes and clear your cache.

Disabling the Module

If you want a more drastic approach that disables the entire Mage_Sales module to prevent it from creating unnecessary pages, you can use Magento’s built-in module disabling feature.

  1. Navigate to your app/etc/modules/Mage_All.xml file.
  2. Find the line for the Mage_Sales module:
<Mage_Sales>
    <active>true</active>
    <codePool>core</codePool>
    <depends>
        <Mage_Core />
    </depends>
</Mage_Sales>
  1. Change <active>true</active> to <active>false</active>.
  2. Save the changes and clear your cache.

Conclusion

Removing unwanted pages in Magento isn’t always straightforward, but it’s a crucial part of maintaining a clean, secure, and optimized e-commerce site. By understanding how to override controllers and disable modules, you can prevent unnecessary pages from being created and indexed.

Remember, whenever modifying core files or disabling modules, always make sure you have a backup of your system in case something goes wrong. It’s also recommended to thoroughly test any changes before deploying them to a live environment.

At Laravel Company, we specialize in helping businesses optimize their Magento platforms for performance and security. If you need assistance with advanced customizations like this, don’t hesitate to reach out to our team of experienced developers.

Themes Configuration Orders Customers

Our network