how to SELECT meta values that are not null?

I founded myself my searching: $sql = $wpdb->prepare( ” SELECT meta_value FROM {$wpdb->prefix}commentmeta INNER JOIN {$wpdb->prefix}comments ON {$wpdb->prefix}commentmeta.comment_id = {$wpdb->prefix}comments.comment_ID WHERE comment_post_ID = %d AND meta_key = ‘rating’ AND meta_value IS NOT NULL AND meta_value <> ” “, get_the_ID() ); $results = $wpdb->get_results( $sql );

REGEXP_REPLACE in post_contet

Ok, if someone in the future also needs something like this, I found the solution after some time of playing with regular expressions. This worked for me: UPDATE `wp_posts` SET `post_content` = REGEXP_REPLACE(`post_content`, ‘https:\/\/www\.example\.com\/magazin\/(.*?)\/”>’, ‘https://www.example.com/magazin/\\1″>’); Example in action can be seen here: https://regex101.com/r/3ZPylJ/1 Hope it helps! Smile to all 🙂