Deleting a second Magento website: Admin Panel “Page Not Found” error

The short version.

  • If you want to delete a second Magento website that you have running on a single Magento instance, you can’t just delete it from the Admin Panel
  • Deleting from the Admin Panel gives a “Page Not Found” error (the Admin Panel is unreachable but you can access the front-end of your default website) so you need to make database changes
  • 4 simple changes in the database will fix the Admin Panel

The detail.

One of the great features about Magento is that you can run multiple websites from a single Magento instance.

I’d been testing this feature then wanted to remove the second store I created (all done on my test install  – not on a live site). I read the instructions and it looked to be a simple case of logging into the Admin Panel and going to:

System > Manage Stores

Manage Magento Stores

Manage Magento Stores

From here, you can select a website and choose to “Delete” it. That’s what I did…and found myself with an Admin Panel error showing a list of paths to missing files.

The reason this error occurs is that removing the Website through the Admin Panel leaves the Website in the database along with any products associated with that Website.

To fully remove the second Website you need to remove it from 3 different database tables and also reassign the products set to the second Website back to the default.

I found these tasks easiest to complete through phpmyadmin.

First, you need to remove the record for the second Website from the following database tables:

core_store
core_store_group
core_website

  1. Login to PHPMyadmin
  2. Find core_store and you will see your default Website and the second one you created. Delete the second website.
  3. Find core_store_group and delete the record for the second Website.
  4. Find core_website and delete the record for the second Website.

Finally, you need to reassign any products only associated with your second Website back to your default Website.

Go to the catalog_product_website table. This is where every product on your Magento instance is associated with a Website ID. Because I only had a second Website with a few products assigned to it, I sorted the “website_id” column and simply deleted the 5 products associated with the second Website.

catalog_product_website table

catalog_product_website table

If you have many products associated with a second Website or multiple Websites running, you would need to run an SQL query.

Top tip.

Remember to clear caches and give the site time to refresh. I made these database changes but had to clear browser cache and reindex my site from the command line for the Admin Panel to come back up again.