Title: Serialized custom field saving integer as string
Last modified: April 20, 2022

---

# Serialized custom field saving integer as string

 *  Resolved [jcmaad](https://wordpress.org/support/users/jcmaad/)
 * (@jcmaad)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/)
 * As you can see from the screenshot, I have a csv file with integer values and
   I am importing them into a serialized custom field that expects an integer: [https://imgur.com/VpyPwYd](https://imgur.com/VpyPwYd)
 * But once I import it, it is imported as a string: [https://imgur.com/N2MvBqU](https://imgur.com/N2MvBqU)
 * How do I fix this?

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

 *  [Aakash](https://wordpress.org/support/users/aakash8/)
 * (@aakash8)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15576328)
 * Try using the PHP function feature along with the intval PHP function on the 
   field.
 * [https://www.wpallimport.com/documentation/import/custom-code/inline-php/](https://www.wpallimport.com/documentation/import/custom-code/inline-php/)
 * [https://www.php.net/manual/en/function.intval.php](https://www.php.net/manual/en/function.intval.php)
 *  Thread Starter [jcmaad](https://wordpress.org/support/users/jcmaad/)
 * (@jcmaad)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15576371)
 * Thanks, but I don’t know how to write php functions. I will have to wait for 
   developers to reply.
 *  [Aakash](https://wordpress.org/support/users/aakash8/)
 * (@aakash8)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15576433)
 * Another option would be to open your CSV file in Google sheets, and make sure
   the format of the columns is set to “number”.
    That may do the trick.
 *  Thread Starter [jcmaad](https://wordpress.org/support/users/jcmaad/)
 * (@jcmaad)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15576511)
 * There is no formatting in CSV though.
 *  Thread Starter [jcmaad](https://wordpress.org/support/users/jcmaad/)
 * (@jcmaad)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15594404)
 * can someone from the dev team respond?
 *  [Aakash](https://wordpress.org/support/users/aakash8/)
 * (@aakash8)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15597947)
 * Hi [@jcmaad](https://wordpress.org/support/users/jcmaad/)
 * Instead of `{rating_count[1]}` as the “value” put `[intval({rating_count[1]})]`
   and the same for other affected fields.
 * This will use the [PHP function feature](https://www.wpallimport.com/documentation/import/custom-code/inline-php/)
   to call [intval](https://www.php.net/manual/en/function.intval.php) which “gets
   the integer value of a variable”.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15604361)
 * Hey [@jcmaad](https://wordpress.org/support/users/jcmaad/),
 * Unfortunately, it’s not possible to type cast the value to an integer using our“
   Serialized” field option. Since this is a pro feature, please contact us at [http://www.wpallimport.com/support/](http://www.wpallimport.com/support/)
   about this so that we can advise on possible workarounds.
 *  Thread Starter [jcmaad](https://wordpress.org/support/users/jcmaad/)
 * (@jcmaad)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15607144)
 * [@aakash8](https://wordpress.org/support/users/aakash8/) do you have any other
   suggestions?
 * [@wpallimport](https://wordpress.org/support/users/wpallimport/) I think it’s
   a pretty basic feature that should be working without any workaround.
 *  Plugin Author [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * (@wpallimport)
 * [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15640848)
 * [@jcmaad](https://wordpress.org/support/users/jcmaad/) thanks for the feedback!
   It’s definitely something we’ll consider if there are a lot of requests for it.

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

The topic ‘Serialized custom field saving integer as string’ is closed to new replies.

 * ![](https://ps.w.org/wp-all-import/assets/icon-256x256.png?rev=2570179)
 * [WP All Import – Drag & Drop Import for CSV, XML, Excel & Google Sheets](https://wordpress.org/plugins/wp-all-import/)
 * [Frequently Asked Questions](https://wordpress.org/plugins/wp-all-import/#faq)
 * [Support Threads](https://wordpress.org/support/plugin/wp-all-import/)
 * [Active Topics](https://wordpress.org/support/plugin/wp-all-import/active/)
 * [Unresolved Topics](https://wordpress.org/support/plugin/wp-all-import/unresolved/)
 * [Reviews](https://wordpress.org/support/plugin/wp-all-import/reviews/)

 * 9 replies
 * 3 participants
 * Last reply from: [WP All Import](https://wordpress.org/support/users/wpallimport/)
 * Last activity: [4 years, 1 month ago](https://wordpress.org/support/topic/serialized-custom-field-saving-integer-as-string/#post-15640848)
 * Status: resolved