Here you go (you’re really close):
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 wp_posts.post_content LIKE '%Customer Reviews%'
AND wp_posts.post_type="post";
`
Edit:
You could also just change IS IN to IN. I rewrote the from part of the query since a subquery was unnecessary though.
Related Posts:
- Change word in woocommerce product category custom field
- SQL Query to copy value of a meta_key into another meta_key
- How to correctly call custom field dates into a posts_where filter using SQL statements
- Add custom fields to search
- SELECT max(meta_value) FROM wp_postmeta WHERE meta_key=’price’… stops working when value is over 999
- How to rename a custom field?
- Bulk move (or copy) from a custom field to the post content?
- Up/Down voting system for WordPress
- Custom Fields Bulk Edit
- Get all posts that do not have a specific custom field without using a subquery
- Order query by meta_value with multiple custom fields
- Custom Field Create Bulk via SQL Query
- UPDATE on SELECT results. A SQL query to swap Author with Meta Box value
- Meta Query And/Or
- Get emails from users by custom field SQL
- Show array of meta_value in Edit Post Coloum
- SQL query to change the value of a Custom Field
- searching by keywords in post’s metas or pagination links problem
- Update custom table on metabox POST
- Convert all dates in field to Unix time, except those already in Unix time
- query specific posts according their custom fields, using sql SELECT
- Alter SQL query to return posts with unique custom field value, no duplicate values
- Update field name without losing the value
- MySQL: Can’t create table (errno: 150)
- Is it safe to store a user setting you don’t want the user to ever modify as a user option?
- extend Meta Box / Document Panel
- Add multiple images to a page sidebar
- getEntityRecord without knowing the post type
- How to load php file for specific page in admin?
- How to set default metaboxes on user creation?
- Moving database with phpMyAdmin
- Metabox nonce PHP notice
- ajax jquery update custom field meta value front end
- How to break meta values into different items and avoid duplicates?
- ajax delete value from custom field array
- Add input field to ‘Pages > Edit Page’ through functions.php
- How can I query on the year part of a complete date in a custom field?
- WordPress Custom Field Should be Unique. Is it possible?
- How to display Meta Field Value?
- Upcoming Event: How do I sort database by custom date field, but ignore past dates?
- What is the cleanest way to extract custom variables from a post
- Add source URL from Feed WordPress (Syndication) plugin to a custom field in post editor
- How To Fix WP Query Returns Results But Shouldn’t?
- Display only past events on that page using Visual Composer Grid Bulider
- user Profile meta value as custom field
- Remove Body Classes
- Use WPbakery for own custom field [closed]
- Change the sort order for posts to include custom field
- Button inside Custom Meta Box triggering the Update Button
- Get Data From wp_sitemeta for Multisite network
- Syntax Issue: How Do I Call A Custom Field Inside a ForEach Statement? [closed]
- Get image url using image id
- Get categories query not working in function.php
- wordpress custom loop ascending descending posts by custom field
- Hide custom fields when empty
- Only show when content added via custom field
- How to add fields in custom registration form, validate it and aave to db? [closed]
- How add multiple wp_editor_box to new post
- Woocommerce frontend edit custom fields
- Related query shows same image in loop
- How to insert multiple checkbox values into post as custom fields from frontend
- Insert posting automatically based in acf field
- Data URI in custom fields
- Add specific custom fields to post formats
- Displaying an ACF list of users
- Custom field to array?
- How to sort by custom field value?
- Meta Box Plugin Cloned Fields – Multiple Foreach values
- get_post_meta returns 0
- How to query posts by month based on date custom field?
- Custom field bug in WordPress 3.2
- Problem with revisions only returning four results
- How to save multiple values with same meta_key, each value linked to another tag id
- Add forms dynamically in admin pages?
- Let any visitors delete a post if they know Id nr & password?
- What WordPress “technology” would I use if I wanted subscribers to be able to mark pages with characteristics and notes?
- how can i show WordPress custom field data to my short code?
- update a custom field with the value of another existing custom field
- Permanently show Custom Fields in Editor
- open modal window
- a lot of custom fields
- Hide custom fields by user’s role
- Ordering posts by custom fields (Date)
- update meta field value after
- PHP and Shortcode Combination
- If metabox fields has content display content
- Custom fields and auto save
- Save values generated via API as custom meta fields
- WP Query multiple select form – meta_query help
- Load code for custom fields only on admin pages?
- Custom field in a shortcode?
- Exclude empty fields from custom field calculation (Average)
- How to create Parent-Child relation for custom fields?
- How to check if custom field exists in this widget query
- How do i output images from URL’s added to the same custom field key
- Add Custom field under the post title [closed]
- Filter Query Post by Custom Fields(by date)
- Can’t sort custom column on user.php by number / meta_value_num?
- Add CSS class to posts with certain meta key
- Match submitted array fields with the MYSQL database fields to update them correctly in PHP