• Resolved garrettm30

    (@garrettm30)


    I have learned that WooCommerce stopped using the wp_postmeta table for product featured and catalog visibility way back in 3.0.0, but I have found out that their old entries for _visibility and _featured are still left in wp_postmeta for older products. I am surprised they weren’t cleaned out when the database was updated when moving to 3.0.0.

    Can anyone confirm that it should be safe to delete those old keys from wp_postmeta table?

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Support Zubair Zahid (woo-hc)

    (@doublezed2)

    Hello garrettm30

    Thank you for contacting Woo support.

    Could you please share more details about your findings?
    Screenshots of the old entries in the wp_postmeta table will be helpful for further clarification.

    I will review the data and make a note for the next update if needed.

    Appreciate your expert feedback.
    Looking forward to your response. ??

    Best regards.

    Thread Starter garrettm30

    (@garrettm30)

    Thank you for your response. I will be glad to provide more information if I can help. Here is a screenshot of the results for querying the postmeta table for an older product (I have changed the table prefix):

    SELECT * FROM wp_postmeta WHERE post_id = 341;

    I confirmed that the post type for post 341 is product. I have 1202 products that have _visibility and _featured meta keys, but all of them are old: the last product with these meta keys was created on April 28, 2016.

    I think when the conversion was made at WooCommerce 3.0.0 to move this meta info to the terms tables, the original records were not removed. That is my understanding from the function wc_update_300_product_visibility() (from includes/wc-update-functions.php starting at 1308). If I’m not mistaken, that is the only place where the current WooCommerce code refers to these meta keys.

    Is there any other information I can provide?

    Hi there @garrettm30,

    While it might be safe to delete _visibility and _featured from wp_postmeta and not affect your store, before you proceed with deleting these keys, it is always recommended to make a complete backup of your database before making such changes.

    This is to ensure that you can restore your site in the event that something unexpected occurs.

    I hope this helps, and please let us know if you have any other questions.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Is it safe to delete _visibility and _featured from wp_postmeta?’ is closed to new replies.