Title: Disable Fields not saving
Last modified: May 6, 2021

---

# Disable Fields not saving

 *  Resolved [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/)
 * Hello,
    I am trying to disable the fields I dont want to use in the output of
   the excel file. when I click the x to remove the field it moves it to the disabled
   column but then it does not save. have tried a few versions of the app to no 
   avail.
 * Wordpress 5.71
    Gravity forms Version 2.5.0.1 Gravity Forms Entries in Excel 
   Version 1.8.10 PHP 7.2 I have 1 snippet meant to remove meta fields (dont need
   them) and that works fine I also have a field on the form that I would like to
   change the a header column name from Section ID to class1 if possible
 * Thank you
    DeLoy Wilkins

Viewing 13 replies - 1 through 13 (of 13 total)

 *  Plugin Author [GravityKit](https://wordpress.org/support/users/gravityview/)
 * (@gravityview)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14409226)
 * Hi [@avidkayaker908](https://wordpress.org/support/users/avidkayaker908/), thanks
   for sharing this issue. Sorry for the problems!
 * Have you tried disabling other plugins except for GF Entries in Excel and Gravity
   Forms, then attempting to save the configuration? I ask because what you describe
   sounds like there _might_ be a conflict.
 * > I also have a field on the form that I would like to change the a header column
   name from Section ID to class1 if possible
 * [Please see this how-to](https://gfexcel.com/docs/changing-labels/). It requires
   code; if you need help with the code, please get in touch with [Codeable.io](https://codeable.io).
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14409284)
 * Thank you very much for the quick feedback. Unfortunately that fix did not work.
   I disabled all plugins except the gravity forms and the Entries in excel plugin
   and still cannot save the settings.
 * On the other note the code to change labels worked perfectly!!
 * I can send a json of my form if you would like as well as a list of plugins. 
   most are part of my gravity perks paid for package.
 * Regards
    DeLoy Wilkins
    -  This reply was modified 5 years, 1 month ago by [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/).
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14412557)
 * Hello,
    Since I cannot get the fields to save. Can you suggest a bit of code 
   to hide said fields? I used the code from your direction to hide the meta fields
   already. I have some experience so just the code where I can put in my fields
   would be great.
 * Thank you for your time!
 * DeLoy Wilkins
 *  Plugin Author [Doeke Norg](https://wordpress.org/support/users/doekenorg/)
 * (@doekenorg)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14412860)
 * Hi [@avidkayaker908](https://wordpress.org/support/users/avidkayaker908/),
 * We’ve found the problem and have fixed it. But there are some issues getting 
   the version released. Hope this is resolved soon. In the mean time you could 
   add something like this to you `functions.php` to disable a few specific fields.
   It’s not very scalable, but I hope you can remove it very soon 🙂
 *     ```
       add_filter('gfexcel_field_disable', function (bool $disabled, \GF_Field $field) {
           if ($field->formId == 1 && $field->id == 3){
               return true;
           }
   
           return $disabled;
       });
       ```
   
 * This hook is called for every field, so you can prettify it how ever you like.
   And don’t forget to `return $disabled` to keep every other field working properly.
 * Hope this helps you out for now. If `1.8.11` is released, you should be able 
   to remove this code, and save the order again. Sorry for the inconvenience. This
   bug is part of the big GF 2.5 update 🙂
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14412964)
 * Thanks for the reply Doeke,
    I tried placing that code and get an error
 *     ```
       Error message: Uncaught ArgumentCountError: Too few arguments to function {closure}(), 1 passed in /home/easycdlonline/public_html/forms/wp-includes/class-wp-hook.php on line 294 and exactly 2 expected in /home/easycdlonline/public_html/forms/wp-includes/functions.php:7869
       Stack trace:
       #0 /home/easycdlonline/public_html/forms/wp-includes/class-wp-hook.php(294): {closure}(false)
       #1 /home/easycdlonline/public_html/forms/wp-includes/plugin.php(212): WP_Hook->apply_filters(false, Array)
       #2 /home/easycdlonline/public_html/forms/wp-content/plugins/gravityforms/gravityforms.php(6563): apply_filters('gfexcel_field_d...', false, Object(GF_Field_HTML), NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL, NULL)
       #3 /home/easycdlonline/public_html/forms/wp-content/plugins/gf-entries-in-excel/src/Repository/FieldsRepository.php(132): gf_apply_filters('gfexcel_field_d...', false, Object(GF_Field_HTML))
       #4 [internal function]: GFExcel\Repository\FieldsRepository::GFExcel\Repository\{closure}(Object(GF_Field_HTML))
       #5 /home/easycdlonline/public_
       ```
   
 * Here is the code I am using form # is 3 and one field to hide is field ID 1
 *     ```
       add_filter('gfexcel_field_disable', function (bool $disabled, \GF_Field $field) {
           if ($field->formId == 3 && $field->id == 1){
               return true;
           }
   
           return $disabled;
       });
       ```
   
 * any thoughts? and can I use an array to hide several fields?
 * Thank You
    DeLoy Wilkins
 *  Plugin Author [Doeke Norg](https://wordpress.org/support/users/doekenorg/)
 * (@doekenorg)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14412969)
 * Argh, thats what I get for not testing code 🙂
 *     ```
       add_filter('gfexcel_field_disable', function (bool $disabled, \GF_Field $field) {
           if ($field->formId == 3 && $field->id == 1){
               return true;
           }
   
           return $disabled;
       }, 10, 2);
       ```
   
 * Forgot the `, 10, 2` which tells the hook what the priority is (10 is default)
   and how many arguments it gets. 2 in our case, but it’s 1 by default. So now 
   it should not give that error again.
 * Returning `true` actually means the field is `disabled`. Hope that makes sense.
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years, 1 month ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14412972)
 * Thank you so much! Worked like a charm.
    I signed up for the PRO notification.
   Such a useful plug-in. Thanks for your time Now onto a great review!
 *  [wgicioau122](https://wordpress.org/support/users/wgicioau122/)
 * (@wgicioau122)
 * [5 years ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14433648)
 * Hi
 * Great plugin, any ideas when this bug fixed will get pushed?
 *  Plugin Author [Doeke Norg](https://wordpress.org/support/users/doekenorg/)
 * (@doekenorg)
 * [5 years ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14440497)
 * Hi sorry for the delay. We ran into some issues deploying this latest version.
   WordPress’ SVN system apparently isn’t ready to deal with PHP 8 code. Which is
   a shame, because it should be the new standard.
 * Anyway, we downgraded some stuff to make WordPress happy, and I just released
   1.8.12. Please let me know if this version works for you.
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14440508)
 * Thanks so much Doeke,
    New version works perfectly! kudo’s and am really looking
   forward to implementing.
 * Kind Regards
    DeLoy Wilkins
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [5 years ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14440520)
 * Doeke,
    can I add more than one form id and field id in this code to replace 
   the label? maybe an array or make it global?
 *     ```
       add_filter('gfexcel_field_label', function($label, GF_Field $field) {
           if ($field->formId === 3 && $field->id === 25) {
               return 'course1';
           }
   
           return $label;
       }, 10, 2);
       ```
   
 * Kind Regards
    DeLoy Wilkins
 *  Plugin Author [Doeke Norg](https://wordpress.org/support/users/doekenorg/)
 * (@doekenorg)
 * [5 years ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14441442)
 * Hi [@avidkayaker908](https://wordpress.org/support/users/avidkayaker908/),
 * Would you mind opening a new topic next time? That way other users can benefit
   as well.
 * I have 2 versions for you. The first is if you are using at leasat php 7.4, which
   you really should 😉
 *     ```
       add_filter('gfexcel_field_label', function ($label, \GF_Field $field) {
           // add to this array like '<table_id>.<field_id>' => 'desired value',
           $label_mapping = [
               '3.25' => 'course1',
           ];
   
           return $label_mapping[$field->formId . '.' . $field->id] ?? $label;
       }, 10, 2);
       ```
   
 * Other wise this should do the same. It’s just a bit more code.
 *     ```
       add_filter('gfexcel_field_label', function ($label, \GF_Field $field) {
           // add to this array like '<table_id>.<field_id>' => 'desired value',
           $label_mapping = [
               '3.25' => 'course1',
           ];
   
           $key = $field->formId . '.' . $field->id;
   
           return isset($label_mapping[$key]) ? $label_mapping[$key] : $label;
       }, 10, 2);
       ```
   
 * I haven’t tested it, but this should do the trick.
 *  Thread Starter [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * (@avidkayaker908)
 * [4 years, 12 months ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14555084)
 * Thanks Doeke, works great!

Viewing 13 replies - 1 through 13 (of 13 total)

The topic ‘Disable Fields not saving’ is closed to new replies.

 * ![](https://ps.w.org/gf-entries-in-excel/assets/icon.svg?rev=3434379)
 * [GravityExport Lite for Gravity Forms](https://wordpress.org/plugins/gf-entries-in-excel/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/gf-entries-in-excel/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/gf-entries-in-excel/)
 * [Active Topics](https://wordpress.org/support/plugin/gf-entries-in-excel/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/gf-entries-in-excel/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/gf-entries-in-excel/reviews/)

 * 13 replies
 * 4 participants
 * Last reply from: [avidkayaker908](https://wordpress.org/support/users/avidkayaker908/)
 * Last activity: [4 years, 12 months ago](https://wordpress.org/support/topic/disable-fields-not-saving/#post-14555084)
 * Status: resolved