Merhaba arkadaşlar,
mysql iki veri arasındaki değerler silinecektir. Wordpress tabanlı bir veri tabanıdır.
Yapılacak işlem:

<span class="entry-meta-item penci-posted-on">1 March 20202 March 2020</span>
1 March 20202 March 2020 şeklinde tarih bulunmakta. Tarihler farklı farklıdır. Tüm postlardaki bu değerlerin hepsi temizlenecektir.

Bunun içinhangi komutu kullanıyorduk?
bu kod ile <span class="entry-meta-item penci-posted-on">
bu kod </span>
kodlar da dahil olmak üzere silinecek


İlla mysql olmasına gerek yok functions.php içine ekleyeceğim actionlada yapabiliriz.

Çözdüm // functions.php İÇİNE ALTTAKİ KODU YAPIŞTIRIP 1 KERE ÇALIŞTIRIN.

add_action ("admin_head","mkt_post_edit");
function mkt_post_edit(){
echo "1111";
$the_query = new WP_Query( array('post_type'=> 'post',"posts_per_page"=>-1) );

while ( $the_query->have_posts() ) {$the_query->the_post();
$content=get_the_content();
//echo $content;
$content=preg_replace('/<span class=\"entry-meta-item penci-posted-on\">.{15,50}<\/span>/', "",$content);
wp_update_post(array('ID' => get_the_ID(),
'post_content' => $content));
echo $content;
}
}