{"id":681857,"date":"2008-01-16T21:32:06","date_gmt":"2008-01-16T21:32:06","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/add-category-via-sql\/"},"modified":"2016-08-19T00:09:48","modified_gmt":"2016-08-19T00:09:48","slug":"add-category-via-sql","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/add-category-via-sql\/","title":{"rendered":"Add category via SQL"},"content":{"rendered":"<p>Through a combination of circumstances &#8211; changing the IA\/category structure of my blog, a move to mostly using tags, imports, exports, upgrades, etc. I have a situation where a large number of my posts have <em>no category<\/em>.<\/p>\n<p>They&#8217;re not assigned the default &#8220;Uncategorised&#8221;; it doesn&#8217;t even exist for the purposes of my blog.  They actually have no category.<\/p>\n<p>What I want is a quick SQL script that will assign a known category to these posts.  I just need some help with the SQL to assign it.<\/p>\n<p>Can anyone offer some ideas, please?<\/p>\n","protected":false},"template":"","class_list":["post-681857","topic","type-topic","status-closed","hentry","topic-tag-categories"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/681857","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/681857\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=681857"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}