eZ Community » Forums » Developer » Remove top-level nodes

Remove top-level nodes

Remove top-level nodes

Monday 13 August 2012 1:03:32 am - 3 replies

Been playing around with the Data Import extension and have cleverly managed to somehow import objects as top-level nodes.

Now I know that you can't remove top-level nodes from eZ Publish easily, but is there an easier way than direct removal from the DB (which can be problematic)?

Monday 13 August 2012 3:07:56 am

Hi Geoff,

Try eep ( https://github.com/mugoweb/eep )

You might get the clean-up done in a one-liner.

There are a couple blog posts with some introductory examples:



I'm keen to be more helpful, so feel free to catch me on skype.

Monday 13 August 2012 8:59:24 am

HI Geoff.

I believe you can write a script that simply first moves moves all nodes with a parent of 1 that is not one of the defaults (2,5,43) to any other location:
I would first try: eZContentObjectTreeNodeOperations::move as it does all of the extra work for you.  But if this has some security in it preventing you from moving them, then you could try the ezcontentobjecttreenode::move directly.


Monday 13 August 2012 12:55:48 pm

Thanks Doug & David - I'll give both options a whirl.  It's only a development DB, so I'm not too concerned, but I've never come across this situation, so it's interesting.


You must be logged in to post messages in this topic!

36 542 Users on board!

Forums menu

Proudly Developed with from