How to Solve “There Was a Category Move Error” in Magento 2
Facing a problem moving categories in Magento 2? Learn here how to fix it.
Magento 2 offers you to create product categories and sub-categories conveniently. In the admin panel, you can create, edit, or re-assign categories and sub-categories. Merchants can also drag and drop the categories and arrange them per their needs.
But quite often, merchants encounter a common error – “There was a category move error” in Magento 2.
In this post, you’ll find a 100% working solution to this error.
But let’s understand the cause of the error first.
What Causes the Category Move Error in Magento 2?
The category move error in Magento 2 is caused by several reasons – the most common one is conflicting URLs. Magento 2 generates category page URLs based on parent and child categories. These URLs are generated as soon as you save changes to the category.
You may face the category move error in Magento 2 if a similar category URL already exists in the store.
How to Solve Category Move Error in Magento 2?
A common workaround to solve the category move error in Magento 2 is by modifying the database directly.
For this, you’ll first need to identify the IDs of the category and subcategory you want to modify.
You can find the category IDs in the Magento admin > Categories section.
Let’s say we want to move the Bags (ID:4) subcategory into the Men (ID:12) category. For this, we’ll need to open the table for categories in Magento 2 via PhpMyAdmin or any other database admin tool.
Now, look up the entry with entity ID = 4 (i.e. our subcategory) and change its parent_id value to 12.
This will assign the Bags subcategory to the Men category from the database.
Save the changes and open Magento 2 admin; the category will be modified successfully.
Conclusion
Modifying the categories database is a common workaround for the category move error in Magento 2. But you need to be cautious while working with the database. It is wise to keep the database backed up, just in case.
You can also try fixing the duplicate URL keys for the categories via Magento 2 URL Rewrites.
Feel free to ask questions in the comments. I will help you!
Share this solution with your Magento friends via social media. Thank You!
Siddharth Nandava
Siddharth Nandava is an enthusiastic Jr Magento developer at Meetanshi. Apart from the work, you can find him learning new things and spending quality time with his family.
Prev
10 Best Shopify Themes For Small Inventory Stores
How to Add a WhatsApp Share Button to Shopify?
Next