Our category URL in the backend is empty. But our sites work fine with the value that was there before. If I create a new category then I do see the URL key value. What can be causing this?

New category=URL key
Old category=no URL key empty

We investigated catalog_category_entity_varchar and saw that many category values were duplicated on a lower (store hierarchy) level. Strange.

Help or clues appreciated

1 Answer 1


I have no idea what happened without seeing code or poking through the db, but...
it may work because the urls come from the core_url_rewrites table.
You might still have values for the categories in there.
But you still need to investigate what happened to the url keys.
Maybe the db is corrupted.
Check if you have values in the catalog_category_entity_vacrchar for the url_key attribute.

You can get the id of the attribute like this:

FROM eav_attribute
WHERE attribute_code = 'url_key' AND
    entity_type_id = (SELECT 
                          entity_type_code = 'catalog_category')

Then get the id from the query above and run

SELECT * from catalog_category_entity_varchar where attribute_id = ID_FROM_QUERY_ABOVE

There is also the possibility that you still have values for the url keys at store view level, but you are missing the ones for the default values scope.
This way the website can function without any issues, but it creates confusion for the admins.

  • hmmmmm first query: url_key return no result (for a know URL key that works) ....
    – snh_nl
    Jun 30, 2015 at 7:56
  • So, something happened to your db. Sorry, but I cannot guess what. Get a backup from a few days ago and compare the values (if you have a backup)
    – Marius
    Jun 30, 2015 at 7:57
  • you are doing the query wrong. There is not attribute id catalog/product_attribute_backend_urlkey. You have to get the actuall id. you took the backend model
    – Marius
    Jun 30, 2015 at 8:29
  • Thanks Marius. It took some time to understand what I was doing. But actually your 'steps' are exactly what solved it. I solved it by getting backup from some days back and compare it to production. All values seem to have duplicates on a lower hierarchy level and all default config (scope 0) values were NULLED. Very strange. But solved through bacjup restore. MANY THANKS!!!
    – snh_nl
    Jun 30, 2015 at 10:15

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.