{"id":39050,"date":"2026-08-11T15:26:55","date_gmt":"2026-08-11T15:26:55","guid":{"rendered":"https:\/\/www.duck9.com\/blog\/?p=39050"},"modified":"2026-08-11T11:27:39","modified_gmt":"2026-08-11T15:27:39","slug":"coded-post-by-larry-chiang-650-283-8008-on-wordpress","status":"publish","type":"post","link":"https:\/\/www.duck9.com\/blog\/coded-post-by-larry-chiang-650-283-8008-on-wordpress\/","title":{"rendered":"Coded Post by Larry Chiang, 650-283-8008 on WordPress"},"content":{"rendered":"<div class=\"postie-post\">\n<div>\n<div dir=\"ltr\"><a href=\"https:\/\/x.com\/larrychiang\/status\/1202646487605243904?s=43&amp;t=zXw0VnDUU9g9Ec306BxNPw\">https:\/\/x.com\/larrychiang\/status\/1202646487605243904?s=43&amp;t=zXw0VnDUU9g9Ec306BxNPw<\/a><\/div>\n<div><\/div>\n<div>from woocommerce import API<\/div>\n<div>import time<\/div>\n<div>import csv<\/div>\n<div><\/div>\n<div>wcapi = API(<\/div>\n<div>&nbsp; &nbsp; url=&#8221;https:\/\/yoursite.com&#8221;,<\/div>\n<div>&nbsp; &nbsp; consumer_key=&#8221;ck_&#8230;&#8221;,<\/div>\n<div>&nbsp; &nbsp; consumer_secret=&#8221;cs_&#8230;&#8221;,<\/div>\n<div>&nbsp; &nbsp; version=&#8221;wc\/v3&#8243;,<\/div>\n<div>&nbsp; &nbsp; timeout=30<\/div>\n<div>)<\/div>\n<div><\/div>\n<div># Loop through your CSV\/JSON of 3000 items<\/div>\n<div>for item in products:<\/div>\n<div>&nbsp; &nbsp; data = {<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;name&#8221;: item[&#8220;title&#8221;],<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;type&#8221;: &#8220;simple&#8221;,<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;regular_price&#8221;: item.get(&#8220;price&#8221;, &#8220;0&#8221;),<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;description&#8221;: item[&#8220;content&#8221;],<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;short_description&#8221;: item.get(&#8220;excerpt&#8221;, &#8220;&#8221;),<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;categories&#8221;: [{&#8220;id&#8221;: cat_id}], &nbsp;# or create categories first<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;images&#8221;: [{&#8220;src&#8221;: img_url} for img_url in item.get(&#8220;images&#8221;, [])],<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; &#8220;sku&#8221;: item.get(&#8220;sku&#8221;),<\/div>\n<div>&nbsp; &nbsp; &nbsp; &nbsp; # add meta_data, attributes, etc.<\/div>\n<div>&nbsp; &nbsp; }<\/div>\n<div>&nbsp; &nbsp; response = wcapi.post(&#8220;products&#8221;, data)<\/div>\n<div>&nbsp; &nbsp; # or use \/products\/batch for up to ~100 at a time<\/div>\n<div>&nbsp; &nbsp; time.sleep(1\u20132) &nbsp;# respect rate limits<\/div>\n<div><\/div>\n<div dir=\"ltr\">\n<div dir=\"ltr\"><span>WordPress\u2019d from my personal iPhone,&nbsp;<a href=\"tel:650-283-8008\" dir=\"ltr\">650-283-8008<\/a>, number that&nbsp;Steve Jobs texted me on<\/span><\/div>\n<div dir=\"ltr\"><span><br \/><\/span><\/div>\n<div dir=\"ltr\">\n<div><font color=\"#000000\"><span>https:\/\/www.YouTube.com\/watch?v=ejeIz4EhoJ0<\/span><\/font><\/div>\n<div><span style=\"font-size: 13pt\"><br \/><\/span><\/div>\n<\/div>\n<\/div>\n<\/div>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>https:\/\/x.com\/larrychiang\/status\/1202646487605243904?s=43&amp;t=zXw0VnDUU9g9Ec306BxNPw from woocommerce import API import time import csv wcapi = API( &nbsp; &nbsp; url=&#8221;https:\/\/yoursite.com&#8221;, &nbsp; &nbsp; consumer_key=&#8221;ck_&#8230;&#8221;, &nbsp; &nbsp; consumer_secret=&#8221;cs_&#8230;&#8221;, &nbsp; &nbsp; version=&#8221;wc\/v3&#8243;, &nbsp; &nbsp; timeout=30 ) # Loop through your CSV\/JSON of 3000 items for item in products: &nbsp; &nbsp; data = { &nbsp; &nbsp; &nbsp; &nbsp; &#8220;name&#8221;: item[&#8220;title&#8221;], &nbsp; &nbsp; &nbsp; &nbsp; [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[],"class_list":["post-39050","post","type-post","status-publish","format-standard","hentry","category-uncategorized"],"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/posts\/39050","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/comments?post=39050"}],"version-history":[{"count":0,"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/posts\/39050\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/media?parent=39050"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/categories?post=39050"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.duck9.com\/blog\/wp-json\/wp\/v2\/tags?post=39050"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}