Change category with SQL
-
in category There are too many post.
Change category with SQL
The post on the category I want to transfer to other categories.
Example:
A category post count:900.000
B,C,D,E,F category post count:0
I Want;
A category post count:150.000
B category post count:150.000
C category post count:150.000
D category post count:150.000
E category post count:150.000
F category post count:150.000
how can I do?
Sample website is highheel tattoo iletisim telefonu
@sidHitesh7 is code work:require(‘wp-load.php’);
$posts = new WP_Query( array(‘category_name’=>’Category 1’) );
if ( $posts->have_posts() ) : while ($posts->have_posts()) : $posts->the_post();
wp_set_object_terms(get_the_ID(), ‘Category 2’, ‘category’);
endwhile; endif;code is work. category changes.
But only 20 post setting working code, to website offline.
20 post setting description: settings ->reading->Blog pages show at most=20the server’s RAM capacity is insufficient (2gb ram)
I can not run so code…any idea?
- The topic ‘Change category with SQL’ is closed to new replies.