Wordpress SQL insert string into custom fields
I have several thousand posts in a custom post type called clothing which have a custom field called wpcf-translation I need to insert a string into every single post's wpcf-translation custom field. But I couldn't find anything on the internet. So my question is, is there an SQL query I can use to insert a string into every single post's custom field wpcf-translation in custom post type clothing? Thanks
Based on your comment : I don't think the field is serialized. , the following should get the job done $args = array( 'post_type' => 'clothing', 'posts_per_page' => -1, ); $query = new WP_Query( $args ); while( $query->have_posts() ) : if( $query->have_posts() ) : $query->the_post(); update_post_meta($post->ID, 'wpcf-translation' , 'your string here'); else : <p><?php _e( 'Sorry, no posts matched your criteria.' ); ?></p> endif; endwhile; wp_reset_postdata(); Ensure that you have a backup in place in case things go awry. Code created on the fly, so might need some fine tuning.
FFMPEG (2.5.7 ) Progress Bar from PHP
How to Display Sequence Random Data like the result before on MySQL using PHP?
Does single multiple INSERT in MySQL give a high difference in speed when you insert just several rows?
Phalcon library class calling a function within another
How Can I reduce view calls on Couchbase?
Add active Class for each img element
CakePHP is version X compatible with PHP Version Y
Compile C code on Wamp Server
How to explode an array from a string?
Google OpenID Connect: Receiving a 500 error when supplying the “max_age” parameter to an authentication request
Pass array as parameter to php script
Using “a href” inside echo [closed]
PHP get value of one column in array
Namespace “src\AppBundle\Entity\YesNo” does not contain any mapped entities.
Order French Language in ABC with MySQL
Laravel 5 TokenMismatchException on PHP 5.6.9