How to Edit PHP Serialized Data Fields?
Smart Manager lets you view and edit PHP serialized fields – special types of fields used by WordPress and WooCommerce to store multiple pieces of information (like arrays or complex data structures) in a single database field. These values are stored as encoded strings that often start with characters like a: (array), s: (string), or i: (integer)
.
For example, a serialized value might look like this:
a:1:{s:3:"url";s:17:"http://mysite.com";}
This represents an array with one key-value pair, where the key is "url"
and the value is "http://mysite.com"
.
While this format helps store structured data efficiently, it’s not easy to read or edit without some technical knowledge. Smart Manager displays these fields in their raw serialized form so you can make changes if needed – but proceed with caution, as incorrect edits can corrupt data or break functionality.
You can edit PHP serialized fields using either the Inline Edit or Bulk Edit functionalities in Smart Manager.
Steps to Edit PHP Serialized Fields with Inline Edit
Below example shows how to edit Upsell IDs
using Inline Edit.
- Go to the Smart Manager dashboard. Using the top navigation bar, search for and select
Products
dashboard from the dropdown menu. - Click on Columns and enable the ‘Upsell IDs’ field. If the field isn’t visible, first edit it for at least one product using ‘WooCommerce > Products’. Then, check the Smart Manager Columns section — if the field appears in the ‘Disabled’ list, simply drag and drop it to enable.
- In the Smart Manager grid, click on the cell under the ‘Upsell IDs’ column for any product (you can use Advanced Search to filter products if needed).
- A dialog will open, displaying the serialized data in a structured format for easier editing.
- From the dropdown, select
Array
as the data type. - Click
Append
to add new values to the array for ‘Upsell IDs’. - Once done, click ‘OK’ to apply the changes.
- From the dropdown, select
- Finally, click ‘Save’ in the grid to store the updated data.
That’s it.
Steps to Bulk Edit PHP Serialized Fields
When using the Bulk Edit functionality, make sure to enter the value as a valid PHP serialized string.
Below example shows how to Bulk Edit Downloadable Files
field data.
- Go to the Smart Manager dashboard. Using the top navigation bar, search for and select
Products
dashboard from the dropdown menu. - Select as many records as you want. You can also apply search filters to filter records and select some records from it to perform the bulk edit operation. To bulk edit all records, tick the header checkbox.
- Click on the Bulk Edit button. It will open up a slide-over panel.
- In the Bulk Edit panel,
- Select the
Downloadable Files
as value in field dropdown. - Choose the action
set to
from the dropdown. - Enter the desired PHP serialized string as the value. For example:
a:1:{s:36:"41610d94-8204-4f8a-9674-56898ab9e2e1";a:3:{s:2:"id";s:36:"41610d94-8204-4f8a-9674-56898ab9e2e1";s:4:"name";s:6:"Single";s:4:"file";s:85:"https://demo.woothemes.com/woocommerce/wp-content/uploads/sites/56/2017/08/single.jpg";}}
- Select the
- Click on the ‘Update’ button. It’ll show you two options to choose:
- Now: To make the changes in bulk instantly.
- Schedule for later: To schedule the Bulk Edit operation for your desired date and time.
- Once you’ve selected the desired option from the previous step, click ‘Ok’ to start the Bulk Edit process.
That’s it. Happy managing!
Notes:
- When working with PHP serialized strings, use caution – incorrect formatting can break the field. It’s recommended to first set the value for a single product, verify that it works correctly, and then reuse that value for Bulk Edit.
- Bulk Edit functionality is available only in the Pro version.