From staging to live with empty values

Support General From staging to live with empty values

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #40707
    info@ceescoenen.nl[email protected]
    Participant

    Hi Peter,

    I have a question: I have events website with testdata. Events, locations and artist. All three have custom fields filled and there are relations using MB relations: Events to Locations and Events to Artist.

    When I copy the website from staging to live I will remove all the testdata. What is the correct way so that the custom fields in the database also removed and the relationtable is cleaned?

    Cees

    #40712
    PeterPeter
    Moderator

    Hello,

    Meta Box and WordPress do not have an official option to delete the field value (post meta). You can create a custom loop and delete post meta with the function delete_post_meta() or use a third-party plugin to do that https://wordpress.org/plugins/wp-bulk-delete/

    For the custom table mb_relationships, you can access your database and delete all rows in the table.

    #40714
    info@ceescoenen.nl[email protected]
    Participant

    Hi Peter,

    Before you answer me I was checking in the database what happens when I remove post_ID 1217.

    When I add the SQL :
    SELECT * FROM wpb8_postmeta WHERE post_id = 1217; is result no rows in the database.

    (Before removing I got 6 rows).

    So it looks like it works, con you confirm this? Or am I looking wrong ?

    #40720
    info@ceescoenen.nl[email protected]
    Participant

    Sorry.. the previous post is not clear:

    I check post_id = 2127 and see one of the custom fields, meta_id = 2494.

    When I remove the post with post_id = 2127 and I check meta_id = 2494 then it is also gone.
    SELECT * FROM wpb8_postmeta WHERE meta_id = 2494

    SO in my opinion the custom fields values are also removed. Can you confirm this?

    #40726
    PeterPeter
    Moderator

    Hello,

    I'm not sure how you deleted the field value, but if that query returns no results, the row (meta ID) is deleted. Or you can go to the database and see the result.

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