A client wants to clean up their messy categories, but when assigning the categories to parent categories, the entries don't update. So when I want to output a list of all entries in a parent category, I might get no results if the entries wasn't originally categorized with the parent category...

I realize there's an answer here: Automatically assign parent category to sub-category entries?

But that PHP-code does nothing for my entries, they're still only categorized with their original categories (which are now child-categories). Anybody got another PHP-code or an SQL-query to help me out?


1 Answer 1


I got a similar code-snippet as the one referred to in my question from Kevin at Ellislab. I couldn't get that one to work initially eiher, but after pruning the code, taking away some ' and " it worked perfectly. Here's the code that worked for me: cdpn.io/DAHeg

Your Answer

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

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