| CARVIEW |
Select Language
HTTP/2 301
date: Sat, 27 Dec 2025 04:35:47 GMT
content-type: text/html; charset=UTF-8
location: https://docs.gravityforms.com/gform_disable_view_counter/
server: cloudflare
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
x-redirect-by: WordPress
fastcgi-cache: MISS
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=tfbPR2oFTJdjb0Us5LeKKaUVSc%2FtYimeh8ScHh0jofvcr3jIRm5xwSjDa60tE1xzFyhJUiXZzItfvQ3h%2BDnqQETQMpOhGhDPcdT5EwIrAzxscmE1"}]}
cf-ray: 9b461cfa284a4e3d-BLR
HTTP/2 200
date: Sat, 27 Dec 2025 04:35:47 GMT
content-type: text/html; charset=UTF-8
server: cloudflare
vary: Accept-Encoding
strict-transport-security: max-age=604800
strict-transport-security: max-age=31536000; includeSubDomains
x-content-type-options: nosniff
x-content-type-options: nosniff
x-xss-protection: 1; mode=block
x-xss-protection: 1; mode=block
x-frame-options: SAMEORIGIN
x-frame-options: SAMEORIGIN
content-security-policy: frame-ancestors 'self';
referrer-policy: no-referrer
referrer-policy: strict-origin-when-cross-origin
link: ; rel="https://api.w.org/"
link: ; rel="alternate"; title="JSON"; type="application/json"
link: ; rel=shortlink
fastcgi-cache: HIT
report-to: {"group":"cf-nel","max_age":604800,"endpoints":[{"url":"https://a.nel.cloudflare.com/report/v4?s=%2BkTurmqhIwAyRP4N%2FSONnZzonK7Hfq%2FnlXzqpKL66LuQ%2FEmkW7jgjCI6VizXHv0dt66ZXpSp5R62dLU5K4kK3EihIqsIlkXVqag1VGuu8lBT%2FZQz"}]}
cf-cache-status: DYNAMIC
nel: {"report_to":"cf-nel","success_fraction":0.0,"max_age":604800}
content-encoding: gzip
cf-ray: 9b461cfd4e1f4e3d-BLR
gform_disable_view_counter - Gravity Forms Documentation
gform_disable_view_counter
Description
This filter can be used to prevent the forms view counter being incremented. The views column will remain displayed on the Forms page.
Usage
The following would apply to all forms.
add_filter( 'gform_disable_view_counter', 'your_function_name' );
To limit the scope of your function to a specific form, append the form id to the end of the hook name. (format: gform_disable_view_counter_FORMID)
add_filter( 'gform_disable_view_counter_5', 'your_function_name' );
Parameters
- $view_counter_disabled bool
Is the view counter disabled. Default false.
Examples
1. Disable for all forms
add_filter( 'gform_disable_view_counter', '__return_true' );
2. Enable for a specific form
add_filter( 'gform_disable_view_counter_12', '__return_false' );
3. Disable for a specific ip
add_filter( 'gform_disable_view_counter', 'disable_view_count_by_ip' );
function disable_view_count_by_ip( $view_counter_disabled ) {
if ( GFFormsModel::get_ip() == 'SOMEIP' ) {
return true;
}
return $view_counter_disabled;
}
Placement
This code should be placed in the functions.php file of your active theme.
Source Code
This filter is located in GFFormDisplay::get_form() in form_display.php
Since
This filter was added in Gravity Forms 1.8.17.