Display Ninja Forms Submissions on the Front End

A petition signer list on a WordPress page showing first names and towns, with no email addresses

Someone posted this on the Ninja Forms support forum in November: “I need to either post data from Ninja forms into a custom table or display data from ninja forms to the front end.” No reply yet. It’s one of those questions that sounds small and then isn’t.

Video: Show WordPress Form Entries on a Page (Free, Any Form Plugin)
Video: Show WordPress Form Entries on a Page (Free, Any Form Plugin) (1:05)

The most common version we see is a petition. People sign, and the organiser wants a public list of signers on the campaign page, because a growing list is the whole point. Other versions: a volunteer roster, a list of registered teams, a “who’s coming” page for an event.

Here’s what Ninja Forms can do on its own today, what the code route looks like, and the privacy part you should sort out before any of it goes live. We also cover the problem in general terms (any form plugin) in how to display form entries on the front end. This post is the Ninja Forms version.

First: decide what is safe to publish

This comes before any plugin choice, because it changes which plugin works for you.

  • Never publish email addresses or phone numbers. Not “just this once”, not in a hidden column. Scrapers read the HTML, not your CSS.
  • Publish less than you collect. For a petition, first name plus town or country is usually plenty. “Priya S., Leeds” still shows a real person signed.
  • Say it on the form. Put a line right above the submit button: “Your first name and town will appear on the public list of signers. Your email stays private.” Better still, add a checkbox (“Show my name on the public list”) and only publish people who ticked it.
  • Plan for removals. Someone will ask to come off the list. Know how you’ll do that before launch.
  • Review before it shows, if you can. Public lists attract joke names and slurs. A step where you approve entries first saves you a bad morning.

If you’re in the EU or UK, our notes on GDPR and WordPress forms go through consent wording in more detail.

What Ninja Forms gives you out of the box

More than many people think. We downloaded Ninja Forms 3.16.1 and read the source. It ships a Gutenberg block called Ninja Forms Submissions Table. You add it to a page, pick a form under “Select Form”, and choose which fields to show as columns in the block settings. If you choose none, it tells you “No columns selected.”

Two things worth knowing before you rely on it:

  • On a published page, the code issues a viewing token to every visitor, so the table is public. That’s what you want for a petition, but it means the columns you pick are visible to the whole internet.
  • We didn’t find a way to hold back individual submissions or show only approved ones. Whatever the form receives can appear. Test it with a junk entry before you announce the page.

If the block does the job, you may be done. Pick name and town, leave email out, publish.

Other Ninja Forms options

Front-End Posting (Ninja Forms extension)

Ninja Forms sells a Front-End Posting extension. It adds a “Create Post” action to a form, so each submission becomes a WordPress post (or page, or a custom post type), and you map fields to the title, content and excerpt. You can set the new post’s status to Draft or Pending Review, which gives you a review step built in.

That’s a different shape from a table. Each signer becomes a post, and you’d then list those posts with your theme’s archive or a post-list block. It works nicely for “user submitted stories”. For a petition with 3,000 names, thousands of posts is a lot of clutter in the editor.

Views for Ninja Forms (third party)

Ninja Forms Views is a separate plugin with a drag-and-drop view builder. The free version does table views with chosen fields, custom column headings and pagination, placed with a shortcode. Its Pro version adds search, filters, sorting, and showing only admin-approved entries, among other things. It had around 1,000+ active installs and an update in early November when we checked.

The custom-code route

If you’d rather not add a plugin, Ninja Forms is friendly to code. In the 3.x source, each submission is a WordPress post of type nf_sub. The form it belongs to is in post meta _form_id, and each field value is in post meta named _field_ plus the field’s ID (so field 12 is _field_12). You don’t have to query that by hand, though. Ninja Forms has a public API for it.

Here’s a small shortcode that lists signers’ first names and towns, but only for people who ticked a consent checkbox. Swap in your own form and field IDs (you can see field IDs in the form builder).

add_shortcode( 'petition_signers', function () {
    if ( ! function_exists( 'Ninja_Forms' ) ) {
        return '';
    }

    $form_id    = 3;   // your form
    $name_field = 12;  // first name
    $town_field = 14;  // town or city
    $ok_field   = 15;  // "show my name" checkbox

    $subs = Ninja_Forms()->form( $form_id )->get_subs();
    $rows = '';

    foreach ( $subs as $sub ) {
        // Skip anyone who didn't tick the box. Check what your
        // checkbox stores; an unticked one is usually empty or 0.
        if ( empty( $sub->get_field_value( $ok_field ) ) ) {
            continue;
        }
        $rows .= sprintf(
            '<li>%s, %s</li>',
            esc_html( $sub->get_field_value( $name_field ) ),
            esc_html( $sub->get_field_value( $town_field ) )
        );
    }

    return $rows ? '<ul class="signers">' . $rows . '</ul>' : '';
} );

Put it in a small custom plugin or your child theme’s functions.php, then drop [petition_signers] on the page.

Honest limits of this snippet:

  • get_subs() loads every submission for the form in one go. Fine for a few hundred, slow for tens of thousands. Past that, cache the output in a transient for ten minutes or so.
  • No paging, search or sorting. You’d be building those yourself.
  • No moderation step beyond the checkbox. To hide a troll entry you’d trash that submission in Ninja Forms, or add a “hidden” list of IDs to skip.
  • Always escape output (esc_html). Visitors typed this text. Treat it as hostile.

The forum poster also mentioned a “custom table”. You can copy each submission into your own database table on submit using Ninja Forms’ action hooks, but unless something else needs that table, it’s extra work. Reading the stored submissions as above is simpler.

Using EntryVault for a Ninja Forms table

To show them, you use the [entryvault_table pipeline="<slug>" access_token="<token>"] shortcode or the “Submissions Table” Gutenberg block. Settings lists a ready-to-paste shortcode for each pipeline, so you don’t have to look up the token. Without the token (or a logged-in user allowed to view that pipeline), visitors just see “Access required.”

The bits that matter for the privacy list above:

  • Default columns are date submitted, name and stage. Email is not shown unless you add it on purpose (columns="...,email"). You can add other form fields as columns, like town.
  • stage="..." shows only entries in one stage. So you can move signers to an “Approved”-type stage after a glance and show only those. Nothing appears until you’ve looked at it. Archived and spam entries never show.
  • Visitors can filter with filters="stage,tag,date" plus any field you show as a column (for example filters="stage,city"). Filters live in the URL, so you can link straight to “signers from Leeds”. There’s also search, sorting, and 25 rows per page.

It won’t do anything the Ninja Forms block can’t if you just want every submission listed as-is. Where it helps is the review step and keeping email out by default.

Which route for which job

Situation Reasonable choice
Small list, every entry can be public The built-in Ninja Forms Submissions Table block
Each submission should be its own page Front-End Posting, with posts set to Pending Review
You want a simple list and are happy with PHP The shortcode above, with a consent checkbox
You need to approve entries before they appear A plugin with a review step (Views Pro or EntryVault’s stage filter)

Whatever you pick, submit one test entry with a fake name and a real-looking email, then open the public page in a private window and check the email isn’t anywhere in the page source. Two minutes, and it’s the check people skip. If your form also lets logged-in members see what they themselves sent, that’s a different problem, covered in showing users their own form submissions.

Frequently asked questions

Can Ninja Forms show submissions on a page without another plugin?

Yes. Ninja Forms 3.x includes a Gutenberg block called Ninja Forms Submissions Table. You pick a form and the fields to show as columns. On a published page the table is visible to every visitor, so leave out email and phone fields.

Where does Ninja Forms store submissions in the database?

Each submission is a WordPress post of type nf_sub. The form ID is stored in post meta _form_id, and each field value is in post meta named _field_ followed by the field ID, for example _field_12. In code, Ninja_Forms()->form( $id )->get_subs() returns them for you.

How do I show a petition signer list without exposing emails?

Only display a first name and town, add a line on the form saying those will be public, and ideally a checkbox so people opt in. Pick the columns yourself rather than showing all fields, and check the page source in a private window to confirm no email addresses appear.