Unpublish content without deleting it

Enonic version: XP 6.3

Is it possible to unpublish content without deleting it?

Not with the admin console in 6.3. Once a content is published, you will have to delete it and then publish the deletion. If it’s something you want to keep then you can “Duplicate” it first, then delete/publish and then change the name of the duplicate to match the original. Of course this will have a new content key and if the original was used as a related content to something else then the other content will need to be updated.

Thanks! Is it possible in later versions of Enonic XP?

I think you can use the API to delete a content on the master branch and leave the draft branch alone. So you could set up a page or service with a controller that will delete from the master branch. Should be simple enough to test it. This might be possible in 6.3 as well.

http://repo.enonic.com/public/com/enonic/xp/docs/6.4.2/docs-6.4.2-libdoc.zip!/module-lib_xp_content.html#.delete

Also take a look at the content.publish() function which can move content both ways between draft and master.

I’ve heard for a long time that an “Unpublish” button will be added to the admin console, but it’s not in the 6.5 snapshot.

Hi Helge,

You can also do it even simpler =)

Just create a folder outside of the site. Set the security settings so that only admin can see it. Now move your content there, publish the move. Voíla - unpublished.

1 Like

Will it be possible to unpublish with the click of a button in a future version? Our customers (especially those that have used Enonic CMS) are often requesting this functionality.

There will be a button for it yes =) However it is not just to “add a button” as we have to resolve a lot of dependencies, even nested ones, and handle all things correctly. But rest assure, it is a high priority.

Another solution is even simpler: Remove the role (in the Security-section) called “Everyone” from the contents you do not want to have accessible by people other than logged in admins.

1 Like

Thanks @bwe. I fully appreciate that it is a little more work than simply going <button onclick=“unpublish()”/> :laughing:

The modify security trick is usable for our more skilled editors, but letting less skilled content producers fiddle with security settings is probably asking for trouble…

Yeah. We have been using the folder-trick on quite a few installations now with great success. So I can highly recommend it. Just move things there. Call folder “Archive”, then it makes more sense. Place it outside the site and restrict normal access.

1 Like