admin管理员组文章数量:1425783
I Cleared off all data in wordpress wp_postmeta, wp_terms, wp_term_relationship, wp_term_taxonomy.
I have post content of 50k. Is there any way I can assign all the 50 posts to a new Category I just created, I will recommend using.?
I Cleared off all data in wordpress wp_postmeta, wp_terms, wp_term_relationship, wp_term_taxonomy.
I have post content of 50k. Is there any way I can assign all the 50 posts to a new Category I just created, I will recommend using.?
Share Improve this question edited Jun 1, 2019 at 22:48 Godwin Alex Ogbonda asked Aug 10, 2018 at 8:46 Godwin Alex OgbondaGodwin Alex Ogbonda 1192 silver badges13 bronze badges1 Answer
Reset to default 1Find out the ID of the category that you want to assign. You'll see it in the URL when editing the category (URL will be something like
?taxonomy=category&tag_ID=3&post_type=post
, here 3 is the ID)Assuming that the ID is 3, you can now run this query in your database (eg via PHPMyAdmin)
INSERT IGNORE INTO wp_term_relationships (object_id, term_taxonomy_id) ( SELECT DISTINCT ID, 3 FROM wp_posts WHERE post_type = 'post' AND post_status = 'publish' );
If you use a different prefix than wp_
, be sure to change it. Also change the 3 to the ID you want.
本文标签: pluginsAssign all Post in Wp to a specific Category
版权声明:本文标题:plugins - Assign all Post in Wp to a specific Category 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1745444448a2658597.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论