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
- How to add a custom field in the advanced menu properties?
- Is there a way to set default custom fields when creating a post?
- Sortable Custom Columns in User Panel (users.php)?
- Importing data for advanced custom fields plugin?
- Gutenberg add a custom metabox to default blocks
- Filter post listing by meta value which is a date
- Extra profile field as select box?
- Matching Serialized Arrays with meta_query
- Pre-filling custom fields on New Post
- So much data in postmeta
- Show only posts which can be commented OR have custom meta field
- Adding Custom Field to Taxonomy Input :Panel
- Make Custom Field Into A Link On The Front End?
- Show Custom Comment Fields when editing in admin
- How do I make a custom field choose an image?
- get_post_meta() unserialize issue – returns boolean(false)
- Unable to get Preview of Uploaded image within a Custom Meta box
- How to activate “custom fields” section in WP3
- Why isn’t my code to save custom fields in quick edit working?
- Edit Custom Database Tables in WordPress
- How to filter or search the posts using postmeta tables custom meta fields with wordpress REST API
- Add meta data to the menu
- How to oEmbed from custom field, responsive to container size and responsive
- Custom Meta Boxes: Store two values in one repeatable field
- Gutenberg Custom Block
- Custom bulk action for media gallery items
- Copy SEO Meta Desc “Custom Field” to Excerpt field?
- Custom fields won’t display on my blog page
- How to customize default wordpress editor?
- Custom Meta Field not Working with qTranslate [closed]
- Change content before writing to database
- Order Custom post type loop by custom field (datepicker)
- Problem in custom meta boxes
- Loop through two different sets of custom fields
- Query Problem – Show posts within category ‘x’ that have a custom field between ‘y’ and ‘z’
- Localized Date Format for Custom Field
- Add an advert every nth Paragraph
- Add description text under input field for new profile fields
- Check if the value of a field has changed on save_post
- How to edit multiple post with Custom fields
- Undefined index error when saving content on metabox
- Metabox with multiple fields added by user and upload box
- Saving custom image meta fields
- How to update custom user meta field in wp?
- Get all meta keys assigned to a post type
- sort search results by custom fields using dropdown
- WP Custom Fields Metabox Disappears – ACF plugin issue [closed]
- Complex WP_User_Query call fails on production server
- Query post order by post and desc not working
- If category then echo a custom fields
- How to query posts with certain custom meta data, and output Post data
- Custom Fields Not in Search Results
- How can I show custom fields in the loop only to specific user roles?
- Add conditional custom option to ‘Display name publicly as’ dropdown
- Custom fields not getting saved in the databse when added to the add new user profile page
- I want to send an email when each post is published
- Creating a widget with a number of custom fields
- How to loop through certain custom field values
- add_action and remove_action if custom field exists
- Show 1 post and after a specific date show the next one
- How to Create Dynamic Fields in a Meta Box?
- Set front page option using custom fields?
- How to show Small Box Inside Content Area, which holds (text, images, links)?
- Sort custom field by post
- How to order posts by one custom field and filter them by another one?
- Can we create a WordPress read-only virtual field derived from three other fields?
- Add post meta fields, when creating a post using WordPress’ REST API
- Store array as single, serialized post meta field or many post meta fields?
- How to create a gallery custom field for WordPress post?
- Custom Field Values not updating unless I click “Update” twice
- Get an advanced custom field after post publish
- How to display image inside container of custom made widget
- update_post_meta for repeated custom field [closed]
- Restose content from revisions – sql query
- Can I create a template or doctype for my blog site?
- Custom field, add class to anchor tag
- List users by sum of all their posts’ custom field values