In dealing with a clients website, it was originally on wordpress.com and many posts were assigned various post_format values (ex. image, gallery). I’d like to change them so they are all “Standard” since they are not relevant in any theme currently used by the site, and in fact cause some issues.
I can’t figure out how to do this. Is there some code I can add in order to add the post_format as a field in the Post editor or bulk edit? Or is there a select statement I could use to do this directly in the database? Where is the post_format field?
Any assistance is greatly appreciated, thanks for your insights!
]]>You can remove the terms through code that loops through a block of posts and calls wp_set_post_terms() with an empty array of terms for “post_format” taxonomy. A block of posts because getting all posts will likely time out. Get only posts who have a post_format term assigned. When none are returned, removal is complete.
]]>So, I think the easiest thing (this site uses the Genesis theme with a child theme called FoodiePro) would be to temporarily add theme support, change them, then remove it. @joyously would this be what I would do?
1. Add this code to the child themes functions.php
add_theme_support( 'post-formats', array( 'standard', 'gallery', 'image' ) );
2. Go to posts screen. Post format should now be an option. Bulk edit all posts where post format <> standard (image or gallery) and make them all standard.
3. Remove the line added in step 1 from the child theme functions.php
Is that correct?
Many thanks both of you for responding, much appreciated.
]]>