I want to select all wordpress posts that have a certain text string.
Then to add a custom field to all those posts.
Here is what I figured out so far but it doesn't work
INSERT INTO wp_postmeta (post_id, meta_key, meta_value) SELECT ID AS post_id, 'customer_reviews' AS meta_key, 'On_or_delete' AS meta_value FROM wp_posts WHERE ID IS IN (SELECT post_id FROM wp_posts WHERE post_content LIKE '%Customer Reviews%') AND post_type = 'post';
Anyone know how to do this please?