19 Dec 06

EE Plugin: Delete Entries Outside of the Control Panel

In Scripts & Resources, Expression Engine

With user generated content being all the rage these days one of the more useful features a content management system can offer is the ability to allow users to submit, modify and remove entries (be they blog items, adverts, images… you get the idea) without actually accessing the behind the scenes admin side of things. Expression Engine is getting there with it’s standalone entry form but there’s still a little way to go. Fortunately Solspace.com offer a free form helper plugin which makes it possible for users to edit their entries, so the only thing missing is the ability to delete entries from the frontend.

As a project I’m working on requires exactly that I’ve thrown together a plugin which makes it possible to delete entries from the frontend. All of the member access level checks in the standard EE deletion code are used, so as long as your member group privileges are setup correctly the plugin shouldn’t be a security concern.

There are two tags used to implement the plugin into your website. The first, {exp:delete_entry:link} is used to generate entry-specific deletion links and the second {exp:delete_entry:delete} is the one that does the dirty work and removes all traces of the entry from the database and updates various counters accordingly.

I’ve written up some plugin usage details, but it may be easiest to try the plugin out on a development install of Expression Engine if you have one. Installation is as simple as saving pi.delete_entry.php into your EE ‘plugins’ directory.

I hope this is as useful to others as it will be for me. Do be careful though as deleted entries are well and truly gone once that button is clicked. Smaller scale sites may benefit from offering a feature which sets an entry status of ‘closed’ instead, as this can ensure the entry is deleted for all intents and purposes but an administrator can bring it back if desired.

Download pi.delete_entry.zip

Posted by Dom Stubbs on 12/19 at 04:19 PM | Trackback
  1. Posted by Mark Bowen on 15/01/07 at 02:20 PM | Link

    Hi there,

    Just came across your post in the pMachine forums and wanted to say thanks for taking the time to put this plugin together. Haven’t tried it yet but I can see that it will come in exceptionally handy!

    A note to other potential users - listen to what has been said before and definitely check user permissions and try it out on a dev server first!! grin

    Thanks again will be trying this out as soon as I get to my dev server at home.

    Best wishes,

    Mark Bowen

  2. Posted by Dom Stubbs on 24/01/07 at 11:16 AM | Link

    Hi Mark,

    I’m glad you like the plugin. I’ve just made a few changes to the code and would recommend that anyone who’s using it updates. There are a couple of changes but one in particular should help the security of the plugin and obviously anything that can be done to improve matters with security is always worth doing.

    Best regards,
    Dom

Commenting is not available in this site entry.

Posts

July 2008
S M T W T F S
    1 2 3 4 5
6 7 8 9 10 11 12
13 14 15 16 17 18 19
20 21 22 23 24 25 26
27 28 29 30 31    

QuickLinks