Formidable Forms

Formidable Forms

  • Features
  • Pricing
  • Resources
    • Docs & Support
    • Blog
    • Community
  • Solutions
    • Web Applications
    • Calculators
    • Surveys
    • Directories
    • Payments
    • Contact forms
  • Login
  • Get Formidable Forms

Delete Entries from the Front-End

Last Updated: April 28, 2020

Knowledge Base → Entries → Editing and Deleting Entries → Delete Entries from the Front-End

Allow users to delete entries by adding a delete link to a page, post, form, or View. When a user clicks on the delete link, the specified entry will be deleted.

Formidable Forms is the best WordPress Form Builder plugin. Get it for free!

In order for the delete link to appear for a logged-in user, your form must allow editing.

Usage

Insert a delete link on any page, post, form, or View in order to allow users to delete entries. Before the delete link will work correctly, you must set up your form to allow editing.

In Views or forms

[deletelink label="Delete"]

This shortcode automatically retrieves the appropriate entry ID from the View or form where it is inserted. To add this link to a form, go into "Settings" → "Customize HTML" and insert the shortcode in the Before Fields or After Fields section.

In pages or posts

[frm-entry-delete-link id=x page_id=y label="Delete"]

Replace x with the ID of the entry to be deleted. Replace y with the ID of the page where the form is published (see page_id in the parameter list below for more info).

Parameters

The following parameters can be used with deletelink and the frm-entry-delete-link shortcode.

Required

  • id (optional for deletelink) - The ID of the entry to delete. An entry ID can be found by going into your form and clicking on “Entries". The furthest left column typically contains the entry ID.
  • page_id - The ID of the page where the form is published. You can find the ID of a page by going into edit the page and looking in the address bar. If the page_id is not specified, this defaults to the current page ID. The page_id parameter can also be used to redirect after deletion of the entry. Insert the page id of the desired destination to redirect the user after an entry or post has been deleted.

    If the deletelink shortcode is loaded via AJAX, you must include the page_id parameter. During an AJAX call, no automatic page id is available.
    WordPress post ID in URL

  • label - Set the label for the delete link. If you do not include a label for the link, the HTML for the link will NOT be returned. Usage: [frm-entry-delete-link id=x label="Delete your entry"]

Optional

  • confirm - Change the text in the pop-up message to confirm entry deletion. By default, this will say "Are you sure you want to delete this entry?". Usage: [frm-entry-delete-link id=x page_id=y confirm="Permanently delete your entry?"]
  • title - Set the value shown when hovering over the delete link. If not specified, this will default to the same value as the label.
  • class - A space-separated list of any HTML classes you would like to add to style the link. Usage: [frm-entry-delete-link id=x page_id=y class="my_class my_class_2"]
  • prefix - If you would like to delete an entry with AJAX and fade out the entry after deletion is complete, use the prefix parameter. In order to use the prefix parameter, you must add a div around your content that will be faded out. If you would like to learn more, see the example below.

Examples

Delete with AJAX

You can delete an entry with AJAX so that it fades away without having to reload the page. In order to do this, you must use the prefix parameter. Next, you must wrap your content that you want to fade out in a div container. This div should have an id like <div id="frm_container_253"> where 253 is the entry ID. This may be how it would look in a View:

<div id="frm_container_[id]">
Insert content here
[deletelink label="delete" prefix="frm_container_"]
</div>

The text in red must match and the delete link must go inside of the container in order for prefix to work properly.

Create Delete Draft Link

You can use a [deletelink] shortcode to allow users to delete a draft once they have created it. Follow these steps to insert a Delete Draft link in your form.

  1. Make sure that your form allows users to save drafts when logged in. For more information on this, click here.
  2. Next, go to Form Settings → Customize HTML and go to the Submit Button field. By default, there is a line for conditionally showing the Save Draft link:
    [if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>[/if save_draft]

    We are going to change this as shown below:

    [if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>   [deletelink label="Delete Draft"][/if save_draft]
  3. Lastly, you can update your form settings. This will cause a Delete Draft link to be shown once users have saved a draft, allowing them to delete their draft and start over if wanted.
  4. Additionally, you can style this delete link if needed by adding the class prefix to the above example, and then writing custom CSS for that class.
    [if save_draft]<a href="#" class="frm_save_draft" [draft_hook]>[draft_label]</a>   [deletelink label="Delete Draft" class="my_custom_class"][/if save_draft]

    Delete Draft Example

PHP Alternative

echo FrmProEntriesController::entry_delete_link( array('id' => x, 'label' => 'Delete') );
  • Usage
  • Parameters
  • Examples
    • Delete with AJAX
    • Create Delete Draft Link
  • PHP Alternative
Categories
×

Categories

  • Installation & Getting Started
  • Account Management
  • Forms
  • Entries
  • Views
  • Styles
  • Importing & Exporting
  • Add-Ons
  • Extend Formidable Forms

Using WordPress and want to get Formidable Forms for free?

Get Formidable Forms Lite Now

This article may contain affiliate links. Once in a while, we earn commissions from those links. But we only recommend products we like, with or without commissions.

Take on bigger projects Right Now

Get the tools you need to revolutionize your workflow and architect a masterpiece. Build the most advanced WordPress forms and actually use the data you collect in meaningful ways.

Get the most advanced WordPress form plugin and the only form builder with integrated Views.

Get Formidable Forms Now

Resources

  • Community
  • Affiliates
  • Contact
  • Free Online Form Builder

Top Features

  • Application Builder
  • Calculator Forms
  • Surveys & Polls
  • Quiz Maker
  • Form Templates
  • Application Templates
  • Directories
  • Donation Plugin

Company

  • About Us
  • Giving Back
  • Careers
  • Newsletter
  • WP Tasty
  • Nutrifox

Copyright © 2023 Strategy11, LLC. Formidable Forms® is a registered trademark Strategy11, LLC.
Privacy Policy | Terms of Service | Sitemap

Join 300,000+ using Formidable Forms to create form-focused solutions fast. Get Started See User Reviews