### [How to Hide Empty Poll Results](https://wpforms.com/developers/how-to-hide-empty-poll-results/)

**Published:** December 9, 2021
**Author:** Editorial Team

**Excerpt:** This tutorial will walk you through how to hide empty poll results from your results page when reporting is enabled. 

**Content:**

## Introduction

Do you want to hide empty poll results generated through the [WPForms Surveys and Polls addon](https://wpforms.com/addons/surveys-and-polls-addon/ "WPForms Surveys and Polls addon")? By default, when you activate reporting after form submission, all options are displayed, even if they haven’t received any votes. Fortunately, with a simple JavaScript tweak, you can customize this behavior. This tutorial will guide you through the steps to hide empty results, providing a more focused view of your audience’s preferences.

## Creating your form

First, you’ll need to create your form and add your poll questions. If you need any help in creating this type of form, [please check out this documentation](https://wpforms.com/docs/how-to-install-and-use-the-surveys-and-polls-addon/ "How to Install and Use the Surveys and Polls Addon").

![start by creating your form and adding your fields](https://wpforms.com/wp-content/uploads/2021/12/wpforms-poll-form.jpg)

## Enabling AJAX

Next, go to **Settings** from inside the form builder. On the **General** tab, click the arrow to open the **Advanced**. Once there, toggle the **Enable AJAX form submission** so that’s it’s enabled.

![enable AJAX on form submission from the advanced form settings](https://wpforms.com/wp-content/uploads/2021/12/wpforms-enable-AJAX.jpg)

It’s important to make sure this step is followed or your snippet will not run. The snippet will only run on forms that have the AJAX enabled on the form submission.

## Enabling Poll Results

Once you’ve enabled AJAX on the form submission, click on the **Surveys and Polls** tab and make sure the **Enable Poll Results** is checked and click **Save** to save the form.

![on the surveys and polls tab, click the checkbox to enable poll results](https://wpforms.com/wp-content/uploads/2021/12/enable-poll-results.jpg)

## Adding the snippet

Finally, it’s time to add the snippet that will hide the poll results.

If you need any help in how to add snippets to your site, [please check out this tutorial](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/ "How to Add Custom PHP or JavaScript for WPForms").

```

/**
 * Hide the poll results if empty
 *
 * @link https://wpforms.com/developers/how-to-hide-empty-poll-results/
 */

function wpf_dev_hide_empty_poll_results() {
    ?>

**Categories:** Tutorials

---

