- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Cant Add Product to Category via Import
Hello
I'm using Magento ver. 2.4.7-p3 and I am attempting to add new products to the site via the built in Import Feature. When I attempt to add a product to an already existing category I am getting the following:
default Category/my-categeory-name/my-category-name" has not been created. URL key for specified store already exists. in row(s): 1
I agree that the category name does already exist, but I'm not trying to add a new category, I'm trying to add a product to the already existing category.
I am selecting the add/update drop down option
in the csv I am adding the values to a header called Category and the value I'm attempting to add is:
categories |
Default Categorymy-categeory-name/my-category-name |
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cant Add Product to Category via Import
The error usually happens if the category path in your CSV doesn’t match exactly with Magento's structure. Make sure the Category column uses the full path, like Default Category/my-category-name. Also, check for extra spaces or typos. If the issue persists, reindex and clear the cache after the import:
php bin/magento indexer:reindex
php bin/magento cache:flush
Let me know if that helps!
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cant Add Product to Category via Import
This issue in Magento 2.4.7-p3 usually happens due to a mismatch in category paths or incorrect formatting in the CSV file. Ensure that the category path in your CSV exactly matches the existing category structure, including case sensitivity. Also, try using just the category name instead of the full path. If the problem persists, manually reassigning a product to the category in the admin panel and then exporting it can help identify the correct format. For those dealing with app-related automation and deployment, https://b9game.pureapk.io/ might be worth checking out.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cant Add Product to Category via Import
It looks like the issue might be with the category path formatting in your CSV. Magento expects category paths to be separated by a forward slash (/) without missing spaces or incorrect capitalization moon phase soulmate. Try verifying that the category names exactly match those in your store, and ensure there are no typos (like "categeory" instead of "category"). Also, clearing the cache and reindexing might help if Magento isn’t recognizing the existing category properly.
- Mark as New
- Bookmark
- Subscribe
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Re: Cant Add Product to Category via Import
Hello @jduffin61g0971,
This issue occurs because Magento is interpreting your category path as a new category instead of assigning the product to an existing one. The error message "URL key for specified store already exists" indicates that Magento is trying to create a duplicate category, likely due to formatting issues in your CSV file.
Magento requires the correct category path format, which must match the actual category hierarchy exactly as it appears in the Admin.
(Ensure that the category names are spelled exactly as they appear in Magento Admin.)
Incorrect Format (causes issues)
- Default Categorymy-category-name/my-category-name (Missing / after "Default Category")
- Default Category / my-category-name / my-category-name (Extra spaces)
Fix your CSV file so that the category names are correctly structured.
Magento does not display "Default Category" in the frontend but still requires it in the backend.
- Go to Catalog > Categories and check the exact spelling of the parent category.
- Copy the correct category path and paste it into the CSV file
Sometimes, incorrect encoding or hidden characters in your CSV file cause issues.
Open the CSV in Google Sheets or LibreOffice, then re-save it as UTF-8 CSV.
Make Sure the Category Exists for the Correct Store View
If you're using multiple store views, the category may exist in one store but not in another.
- Go to Stores > All Stores and confirm the correct store ID.
- In your CSV, add a column: store_view_code
- Leave it blank for all stores
- Use default for the default store
After Changes re-run all commands and reindex it and check it will allow you to import in existing category.
If the issue will be resolved, Click Kudos & Accept as a Solution.