admin管理员组文章数量:1395198
I have about 25 000+ posts and I need to update all of them.
Main question is if this will make server/hosting down or break anything )
I found this code which goes in functions.php and works, but another problem here is that it sets same published date/time to all posts
function update_all_posts() {
$args = array(
'post_type' => 'post',
'numberposts' => -1
);
$all_posts = get_posts($args);
foreach ($all_posts as $single_post){
$single_post->post_title = $single_post->post_title.'';
wp_update_post( $single_post );
}
}
add_action( 'wp_loaded', 'update_all_posts' );
本文标签: Update all posts25 000 posts in total
版权声明:本文标题:Update all posts - 25 000 posts in total 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744652705a2617781.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论