• Resolved simon1970

    (@simon1970)


    I’m working on a WordPress website that has lots of Woocommerce products. I can’t add a link to the site because the site is not live at the moment. I use an ACF field on each product to list the different sizes of the products, eg. 60 x 120 cm. I just noticed that I have made a mistake with many of the sizes and need to make the same change to a large number of products. I was going to write some code to do this task but firstly I need to find this data in the database, but I can’t find it. I’ve searched online but can’t find the answer. I’ve searched through wp_posts and wp_postmeta but it doesn’t seem to be there.

    To be clear, I’m searching for a block of text/html in the WordPress database that includes the data I entered into the custom field on the Edit Product page of each product.

    How can I find this data from within phpMyAdmin? I may need quite specific instructions as I have already searched through wp_posts and wp_postmeta without success.

    Thanks!

Viewing 2 replies - 1 through 2 (of 2 total)
  • Thread Starter simon1970

    (@simon1970)

    I have now found the data I was looking for by searching the entire database for a specific string. The data was stored in the wp_postmeta table with a meta_key of ‘dimensions’, which is the name I gave to the custom field when I created it.

    Thread Starter simon1970

    (@simon1970)

    If this helps anyone, here is the query I used to replace a substring with another string in phpMyAdmin. The meta_key is the name I gave to the custom field (dimensions):

    UPDATE wp_postmeta SET meta_value = REPLACE(meta_value, ’60 x ‘, ‘60.0 x ‘) WHERE meta_key = ‘dimensions’;

    The mistake I had made was in the format of the numbers, with the default format having 1 decimal place. The decimal was missing from every instance with the number 60, so the query adds the ‘.0′ to every instance of ’60’ within the table.

Viewing 2 replies - 1 through 2 (of 2 total)
  • You must be logged in to reply to this topic.