> For the complete documentation index, see [llms.txt](https://docs.super-forms.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.super-forms.com/developers/code-examples/show-remaining-available-form-submission-allowed.md).

# Show remaining available form submission allowed

{% hint style="danger" %}
**Important:** In order for the below code to work properly you will require to enable the [Global form locker](/features/advanced/lock-and-hide-form.md#lock-form-after-specific-amount-of-submissions) setting on your form.
{% endhint %}

{% hint style="info" %}
**Note:** The form locker/submission count is not connected to the Contact Entries created by the form. Deleting entries will not affect the counter. Instead it is based on the period chosen, Daily, Monthly, Yearly etc. as shown in the picture at the bottom of this page.
{% endhint %}

Copy and paste the below code at the bottom of your child theme **functions.php** file.

```php
function retrieve_submission_count_shortcode($atts) {
    extract(shortcode_atts(array('form_id' => 0), $atts));
    return absint(get_post_meta($form_id, '_super_submission_count', true));
}
add_shortcode('submission_count', 'retrieve_submission_count_shortcode');

function retrieve_remaining_submission_count_shortcode($atts){
    extract(shortcode_atts(array('form_id' => 0), $atts));
    $settings = SUPER_Common::get_form_settings($form_id);
    $limit = 0;
    if(!empty($settings['form_locker'])){
        if(!isset($settings['form_locker_limit'])) $settings['form_locker_limit'] = 0;
        $limit = $settings['form_locker_limit'];
    }
    $count = get_post_meta($form_id, '_super_submission_count', true);
    return $limit-absint($count);
}
add_shortcode('remaining_submission_count', 'retrieve_remaining_submission_count_shortcode');
```

You can now use the below shortcode to display the remaining amount of allowed submission for this form. Replace `123` with your form ID. You can use this shortcode anywhere on your page. But you can also use it inside your form [HTML Element](/elements/html-elements/html-raw.md).

```
Total submissions (current period): [submission_count form_id="123"]
Remaining submissions (current period): [remaining_submission_count form_id="123"]
```

<div align="left"><figure><img src="/files/9Wo2hEKJZ4scpRYL6K5x" alt="WordPress form locker settings, reset submission counter every month."><figcaption><p>WordPress form locker settings, reset submission counter every month.</p></figcaption></figure></div>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://docs.super-forms.com/developers/code-examples/show-remaining-available-form-submission-allowed.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
