How to Display a List of WPForms Using a Shortcode

Would you like to display a list of all forms created with WPForms on your site? Whether you want to show this list publicly or on a password-protected page, you can easily create it using a custom shortcode.

This guide will show you how to create and use a shortcode that displays all your created forms in a simple list format.

Creating the Shortcode

First, you’ll need to add this code snippet to your site. This snippet creates a shortcode that you can use on any post, page, or widget area on your site to display a list of all the forms created with WPForms.

If you need any help in adding code snippets to your site, take a look at our tutorial on adding custom JavaScript or PHP code in WPForms.

This code works by:

  • Creating a new shortcode named wpforms_all_forms
  • Retrieving all published WPForms from your site and extracting the form titles
  • Displaying them in a list with line breaks between each form

Displaying a List of Forms created with WPForms

Once you’ve added the snippet above to create the shortcode, you’ll need to add this shortcode to a page, post or widget area on your site in order for the list of WPForms to display.

For our tutorial, we’re not using a page builder but WordPress Gutenberg Shortcode block to add in our shortcode to the page.

Simply add [wpforms_all_forms] to the page and click Publish and you’ll now see a complete list of your WPForms available.

Add the shortcode to any post, page, or widget area to display a list of all your forms

Note: Most popular page builders also have a similar block in their builders. Please check with your specific page builder’s documentation to find out how best to add a shortcode to a page.

And that’s it! You’ve now created a shortcode that you can use to display a list of all your forms created with WPForms. Would you like to also create a shortcode to display a list of entries for each form? Take a look at our tutorial on How to Display Form Entries.