Home › Forums › General Issues › SQL query for my article (custom fields) › Reply To: SQL query for my article (custom fields)
Hello,
I looked at your link
but I did not understand
or I have to put the custom fields
And I found this query but it does not work
INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT wp_posts.ID, 'my-custom-field', 0 FROM wp_posts WHERE wp_posts.post_status = 'publish' AND wp_posts.post_type='hello';
-> https://snippets.khromov.se/batch-adding-custom-field-to-posts/
I am looking for a query that can add custom fields and make all update to post
thanks
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.