Skip Navigation

[Resolved] Bulk update posts

This thread is resolved. Here is a description of the problem and solution.

Problem:
Can we bulk update posts with Toolset?

Solution:
No, it does not provide such features, but there are a few steps you may consider:
https://toolset.com/forums/topic/how-can-i-set-a-default-custom-taxonomy-to-posts-already-created/#post-608231

This support ticket is created 6 years, 10 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- - 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00 14:00 – 20:00
- - - - - - -

Supporter timezone: Asia/Ho_Chi_Minh (GMT+07:00)

This topic contains 2 replies, has 2 voices.

Last updated by raulE-2 6 years, 10 months ago.

Assisted by: Beda.

Author
Posts
#608186

I have a site with 6.000 custom posts. I want to create a new custom taxonomy for them.

Is there a way to create a default taxonomy value for all the 6.000 custom posts already posted?

Thank you

#608231

Not within WordPress GUI's.

You need to run some Custom Code or use a 3rd party plugin to bulk-update all already existing posts.

I suggest a good database backup before you proceed, and then create a custom PHP template that you can call in the Browser.
In this PHP template place a script that wp_set_post_terms() after you get_posts() all the Posts you want to update.
https://codex.wordpress.org/Function_Reference/wp_set_post_terms
https://codex.wordpress.org/Template_Tags/get_posts

With this, you can update all posts you got in get_posts() with a new term, using wp_set_post_terms.
This script needs to be called once only, and all those posts will feature the new term.

But this is not something that Toolset offers, neither WordPress.

Another approach is to bulk edit the Posts in the Post List.
There, check all posts (you may need to proceed in bulks) and in the Bulk Actions choose edit.
Check the new term and save.

Those are a few possible approaches.

#608271

Thank you.