I have another blog called Boriken365. Not so long ago the website was hacked by one of the biggest hacks to the Revolution Slider. This made me to give a little tender loving care to that website. The wordpress theme was changed and the new one uses the Post Format options. Because of this, we start to modify each post by one one and this was not fun. That blog has more than 900 posts. After digging in the Internet for some hours I found this solution via the wordpress interface but that blog has too much posts to do it manually.

Anyways, with a little of wordpress experience and a lot of SQL experience in my resume I did the trick via MySQL.

Please do this ******** AT YOUR OWN RISK ********. Please make a backup of your database before continuing.

First you have to look for the term_id in the wp_terms table with the name post-format-image.  In my case the value was 1741.  Using this value look for the term_taxonomy_id in the wp_term_taxonomy table.  In my case the value was 1748.  After having this values you have to insert the records in the wp_term_relationships table. Because in my case ALL posts are images I delete all the records before inserting the new ones.

This is my Script.

SELECT term_id FROM wp_terms WHERE name = 'post-format-image'

SELECT term_taxonomy_id FROM wp_term_taxonomy WHERE term_id = 1741

DELETE FROM wp_term_relationships WHERE term_taxonomy_id = 1748

INSERT INTO wp_term_relationships(object_id, term_taxonomy_id, term_order)
SELECT ID, 1748, 0 
FROM wp_posts
WHERE post_status = 'publish' and post_type = 'post'

Here is the current wordpress table layout..

(Visited 253 times, 1 visits today)