I need a function to duplicate an (published) entry as a draft entry. Now if I duplicate an entry it will immediately publics that entry an that fires some plugin events (sends mails) I didn't want.

  • 1
    I'm not sure I'm following 100%, but it sounds like you want to duplicate an entry and have it set to disabled by default?
    – Brad Bell
    Apr 21 '17 at 17:32
  • Sorry for my bad English I meant a draft entry not a concept entry (that's how we call it in Holland). The client publish a entry and after that he want to duplicate that published entry but as a draft and not immediately publish it because the client want to make some changes first and then publish the duplicated entry. After publishing a plugin sends a mail to all users. Therefore it should not be published immediately. Apr 25 '17 at 10:32
  • No worries, Maarten... it'd definitely need to be done through a plugin and Brad answer is a good starting point.
    – Brad Bell
    Apr 26 '17 at 17:48
  • Is there any better/simpler solution to achieve this ? May 19 '20 at 14:39

You can refer to this How can I copy an entry?

Just change:

$newEntry->enabled = $oldEntry->enabled;


$newEntry->enabled = false;

To start out building your own plugin: https://pluginfactory.io/, be sure to select the Services lightswitch.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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