-
15
-
08
-
2023
Kategorisi : Wordpress
DELETE FROM b_users
WHERE
b_users.ID NOT IN (SELECT
meta_value
FROM
b_postmeta
WHERE
meta_key = '_customer_user')
AND b_users.ID NOT IN (SELECT DISTINCT
(post_author)
FROM
b_posts) LIMIT 100
;
DELETE FROM b_usermeta
WHERE
b_usermeta.user_id NOT IN (SELECT
ID
FROM
b_users);
-
20
-
06
-
2016
Kategorisi : Wordpress
update w_postmeta set meta_value = meta_value * 1.25 where meta_key=’_price’
-
28
-
07
-
2015
Kategorisi : Wordpress
functions.php'ye bu kodları ekliyoruz.
add_action ('init', 'remove_featured_images' );
function remove_featured_images () {
global $wpdb;
// The following query will only unset the featured image, it will not delete it.
$wpdb->query( "
DELETE FROM $wpdb->postmeta
WHERE meta_key = '_thumbnail_id'
" );
}
-
01
-
06
-
2015
Kategorisi : Wordpress
$post_if = $wpdb->get_var(“SELECT count(post_title) FROM $wpdb->posts WHERE post_title = ‘some text'”);
if($post_if < 1){
echo “var”;
} else {echo “yok”;}
-
04
-
08
-
2014
Kategorisi : Wordpress
Toplu tarih değişimi – wordpress
UPDATE wp_posts SET post_date = ‘2014-08-04 17:02:52’ WHERE post_type = ‘post’ AND ID LIKE ‘%63%’
-
07
-
07
-
2014
Kategorisi : Wordpress
Bir kategorideki tüm yazıları silmek için gerekli sql kodumuz :
delete a,b,c,d
FROM w_posts a
LEFT JOIN w_term_relationships b ON ( a.ID = b.object_id )
LEFT JOIN w_postmeta c ON ( a.ID = c.post_id )
LEFT JOIN w_term_taxonomy d ON ( d.term_taxonomy_id = b.term_taxonomy_id )
LEFT JOIN w_terms e ON ( e.term_id = d.term_id )
WHERE e.term_id =1
-
27
-
05
-
2014
Kategorisi : Wordpress
SELECT a.ID, a.post_title, a.post_type, a.post_status
FROM wp_posts AS a
INNER JOIN (
SELECT post_title, MIN( id ) AS min_id
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
GROUP BY post_title
HAVING COUNT( * ) > 1
) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'
------------------------------------------
DELETE a.*
FROM wp_posts AS a
INNER JOIN (
SELECT post_title, MIN( id ) AS min_id
FROM wp_posts
WHERE post_type = 'post'
AND post_status = 'publish'
GROUP BY post_title
HAVING COUNT( * ) > 1
) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = 'post'
AND a.post_status = 'publish'
-
19
-
04
-
2014
Kategorisi : Wordpress
DELETE pm
FROM wp_postmeta pm
LEFT JOIN wp_posts wp ON wp.ID = pm.post_id
WHERE wp.ID IS NULL
-
18
-
02
-
2014
Kategorisi : Wordpress
DELETE a.*
FROM wp_posts AS a
INNER JOIN (
SELECT post_title, MIN( id ) AS min_id
FROM wp_posts
WHERE post_type = ‘post’
AND post_status = ‘publish’
GROUP BY post_title
HAVING COUNT( * ) > 1
) AS b ON b.post_title = a.post_title
AND b.min_id <> a.id
AND a.post_type = ‘post’
AND a.post_status = ‘publish’
-
13
-
02
-
2014
Kategorisi : Php,Wordpress
Her insert işleminden sonra taxonomy’i “_children” ile silmemiz gerekiyor. Mesela taxonomy = kategori ise ;
delete_option(“kategori_children”);
yazıyoruz.
wp_insert_term(
$kategori_adi,
‘category’,
array(
‘description’ => $aciklama,
//’slug’ => $slug,
‘parent’ => 0,
)
);
delete_option(“category_children”); //