Support

Account

Forum Replies Created

  • thanks a lot John.
    I have this query to view the postmeta files that do not have any post relation

    SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL

    But the query do not show only the advanced custom fields files.
    On the next query I have added the acf field to select only these fields

    SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL AND pm.meta_key LIKE '%my-custom-field-name%'

    And now I would like to know if the query is correct and i can make the delete query without problems and errors on my wordpress after

    DELETE FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL AND pm.meta_key LIKE '%my-custom-field-name%'

  • Could any admin form advanced custom fields comment this post if i’s possible to clean the post_meta table with not problems?
    On my first message I comment what is the problem?
    I deleted with php my admin the post revisions and now there are a lot of custom fields files on the post_meta table. some of them without post_id relation, other with no content…

  • Have anyone deleted the post_meta files from my custom fields that are without post_id?
    Is dangerous?
    SELECT * FROM wp_postmeta pm LEFT JOIN wp_posts wp ON wp.ID = pm.post_id WHERE wp.ID IS NULL

    is there any query to make that?

  • thanks a lot James
    I have 197.508 rows with empty meta_value on wp_postmeta table.
    I think it’s a lot of rows but if you think it shouldn’t affect my database performance much I’m thinking in not to delete them.
    Not all are from ACF fields. 47.460 rows are from ACF fields.

    1- do you think I have to delete them?

    2- if i delete them and I go to modify one post can I insert something on the post after I have deleted it or it’s not possible?

    3- On the table I have for example the field “mytext” and I see that on some of them there is also a field like “_mytext”. When I have the two items the item “_mytext” is for example = field_517ea3ab37372 and the item “myfield” is empty. the two items have the same post_id. If I delete the empty “myfield” row could it be a problem?

    To select only the custom fields empty I do
    SELECT * FROM wp_postmeta WHERE wp_postmeta.meta_value = ” AND (wp_postmeta.meta_key =’myfield’ OR wp_postmeta.meta_key =’myfield2′)
    and I get 47.460 rows

    sorry for the questions and thanksa lot.

Viewing 4 posts - 1 through 4 (of 4 total)