WordPress Etsy Widget

January 18th, 2010 by: joshua

You may have noticed the new Etsy thumbnail display in the sidebar. I coded this up last week because Cheyenne wasn’t happy with Etsy Mini. The issue was that there wasn’t an easy way to adjust the background colors and other styling elements because Etsy Mini embeds an iframe or flash object. While poking around for a solution I discovered that Etsy has a public API so I went ahead and signed up as a developer and created this simple plugin for WordPress. It has more or less the same layout as Etsy Mini but it inherits css styles from the sidebar and it’s possible to customize it in your theme’s css file by using the ‘etsy’ class.

It’s free and licensed under GPL so go ahead and install it on your own wordpress site. Download it from wordpress.org and if you have trouble leave a comment here and I’ll try to help.

Here is a screenshot of the admin interface.

The term ‘Etsy’ is a trademark of Etsy, Inc.  This application uses the Etsy API but is not endorsed or certified by Etsy, Inc.

81 Comments on “WordPress Etsy Widget”

  1. alice says:

    Hi, I’m trying to use your plugin for an etsy shop on my website. Its a wordpress and I can’t figure out how to get to the sidebar that you show in the above screenshot. The only option wordpress is giving me is to edit the actual code of the plugin which I don’t think I should do. Any help would be greatly appreciated.

  2. joshua says:

    On your wordpress admin dashboard click on “appearance” then “widgets” (it should be right under themes). After you have activated the plugin it will appear on this page under “available widgets.” Drag and drop the widget onto your sidebar (right). Of course, this assumes that your theme supports widgets (most do). There could be one or more sidebars available and if the names aren’t obvious you may have to experiment to see where it appears.

    If you’re having trouble installing it. The easiest way is to choose “Plugins” then “Add New” from you admin dashboard. Enter “Custom Etsy” into the search box and it should come up. Click install (far right).

  3. Amelia says:

    This plugin is awesome, and works awesomely in the sidebar. I would love it if you would consider posting instructions to use your code in the main page area of a wordpress site as opposed to just as a sidebar widget. The existing Etsy Mini code really doesn’t fit in with most websites.

  4. Chris Loringer says:

    Hey I’m having trouble getting 3 columns to show up. Do you have any idea why I can only get 2 columns even though my settings are set for 3 columns?
    (note: I tried making them 50×50 just to see if it was a size issue and that did not work)

  5. joshua says:

    Hi Chris, Thanks for the bug report. I guess I didn’t test the column layouts too thoroughly. It turned out to just be a typo. It should be fixed if you upgrade to version 1.0.4.

  6. joshua says:

    Hi Amelia, I’m glad you like the plugin. When I have some free time I’ll look into creating a tag for embedding the widget into articles. I’m not sure when that will happen, but I’ll send you a note if it does.

  7. Chris Wright says:

    Hello Joshua

    Thanks for the great plugin. Much nicer then the Etsy one that shows links to Etsy – not just your Etsy account but just Etsy frontpage or whatever category you happen to post in.

    I am also having the same issue as the other Chris. When I select two columns or two rows it still only shows me one picture. I am running 1.0.4, auto installed through wordpress.

    Thanks much

  8. joshua says:

    Hi Chris W,

    Since you only have 2 items in your etsy shop it obviously won’t show more than that. Additional rows and columns won’t display even though they show up in the HTML. I see on your site that only a single item is showing. I suspect that the problem is simply a stale cache. The cache is refreshed every 6 hours. The other item should show up then. You can clear the cache manually if you log into your shell account.

    On a unix server, the command would be:

    rm -f /tmp/etsy*

  9. Chris Wright says:

    I tried the waiting thing and
    … Looks like you’re right! Both items are showing up now!

    Thanks much!

  10. Susan says:

    I love your plugin! In your readme you say:

    6. If desired, add custom styling to your theme for the ‘etsy’ css class, otherwise it will default to sidebar style rules.

    Is this difficult to do? If not could you give me an idea how?

  11. joshua says:

    Hi Susan,

    You need to edit the style.css file in your theme. The file is located in the wp-content/themes/THEME_NAME directory.

    For example, if you wanted it to have a pink background. And also wanted a 1 pixel red border around the entire widget as well as each image. You would add the following lines to the css file.

    background-color: pink;
    border: 1px solid red;

    .etsy img{
    border: 1px solid red;

    You can finds lots of information about css at w3schools (http://www.w3schools.com/css/default.asp).

  12. Laura says:

    Hi, I’m excited to use this widget but when I put it in my sidebar the title “Curry Kay Designs’ Shop” comes up but without any boxes. I have 9 items in my shop so there is something from the widget to show.

    Any ideas?

    Thanks so much!

  13. becky says:

    I’m not sure what I’m doing wrong but for some reason I get all this code on my side bar – Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/tmp/etsy10099111_cache_sundaydrivedesigns.com.json) is not within the allowed path(s): (/var/www/domains/sundaydrivedesigns.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php) in /var/www/domains/sundaydrivedesigns.com/docs/blog/wp-content/plugins/etsy-widget/etsy-widget.php on line 179

    Warning: file_put_contents() [function.file-put-contents]: open_basedir restriction in effect. File(/tmp/etsy10099111_cache_sundaydrivedesigns.com.json34962961.tmp) is not within the allowed path(s): (/var/www/domains/sundaydrivedesigns.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php) in /var/www/domains/sundaydrivedesigns.com/docs/blog/wp-content/plugins/etsy-widget/etsy-widget.php on line 168

    Warning: file_put_contents(/tmp/etsy10099111_cache_sundaydrivedesigns.com.json34962961.tmp) [function.file-put-contents]: failed to open stream: Operation not permitted in /var/www/domains/sundaydrivedesigns.com/docs/blog/wp-content/plugins/etsy-widget/etsy-widget.php on line 168

    Warning: rename() [function.rename]: open_basedir restriction in effect. File(/tmp/etsy10099111_cache_sundaydrivedesigns.com.json34962961.tmp) is not within the allowed path(s): (/var/www/domains/sundaydrivedesigns.com/:/usr/share/phpmyadmin:/etc/phpmyadmin:/var/www/myfilemanager:/var/www/myinstaller:/usr/local/lib/php) in /var/www/domains/sundaydrivedesigns.com/docs/blog/wp-content/plugins/etsy-widget/etsy-widget.php on line 169

    and then the widget seems to as it should be under the miles of code. Any suggestions?

  14. richard says:

    Hi, I see the widget is creating some temporary files: * randomnumber.tmp * and placing them from wherever the widget is accessed. How is this working? Wouldn’t it be better to place them in a single cache location? I’m finding myself having to delete temporary files in my wordpress installation.

    Great widget though!

  15. michele says:

    great plug in.
    I was wondering if when the link to my etsy store, or when they click on a product if the link could open etsy on a new window, something like (target=”_blank”)?
    Thank you,

  16. joshua says:

    Hi Richard,

    The cache files are written to the location returned by the php function “sys_get_temp_dir”. It would be better to use the wordpress cache but it’s not enabled by default and I wanted this widget to be as easy as possible to install. The *.tmp files should be immediately renamed to a single *.json file of the form etsy_cache_.json.

    If you are finding that you get a lot of *.tmp files hanging around then the file rename is failing and the cache isn’t working at all. There are a couple of reasons why this might be happen but the most likely is that old cache files are owned by a different user (maybe the ownership was changed during a system restore or some other automated process). Try deleting the json file from the shell. If you find that you don’t have permission to delete it then this is definitely the problem and the best solution is to ask your sys admin to delete them for you. It should start working correctly again after these files are cleared.

    If you know a little php it should be easy for you to change the sys_get_temp_dir call and replace with a cache location more to your liking. Maybe I’ll add this as a configuration option in the next version.

  17. joshua says:

    Richard and Becky, I updated to widget to version 1.0.5. The new versions includes a configuration option to set the cache location. It defaults to whatever is returned by php’s sys_get_temp_dir function, but you can change to any place you like.

    Becky, in your case, try /var/www/domains/sundaydrivedesigns.com or /var/www/domains/sundaydrivedesigns.com/cache

  18. Tony says:

    Hi Josh, I activated your plugin and when it’s activated, the widget panel in my admin is messed up and I can’t make any changes to the the widget placement on the site. When I deactivate the plugin, the widget panel is fine.

    Think this is an issue with the newest version of wordpress and your plugin, or something wrong in my wordpress install?

  19. ithinkitsnice says:

    I’m having the same problem as Tony, right after the 3.0.1 upgrade.

  20. ithinkitsnice says:

    it’s as if the widget admin page fails to load right as it reaches the etsy widget

  21. Pam says:

    I am having the same problems that others here mentioned. I also have this plugin when activated mess up the admin area. Did anyone find a way to fix this? I’d love to have this on my site.

  22. Larry says:

    Hi i was able to load the plug in but no love on the pics from the site it wont show them what shall i do?

  23. ithinkitsnice says:

    Trying this on another site now — no images display in your widget. clean install of WP3.01 and your plugin.

  24. ithinkitsnice says:

    …and using firebug I’m seeing

  25. ithinkitsnice says:

    ^ oops, tried to post html there

    should have been: [img src=” “] with angle brackets obv

    ie, no image source is being defined

  26. joshua says:

    I think I see the problem. At the end of August, Etsy removed all but the 75×75 and 170×135 sized images. If you use one of those it should work. At least until the end of the week when the v1 API is disabled. I’m working on upgrading to v2 of the API so an upgrade will be required on Nov. 1st.

  27. Deb says:

    Hi, Josh.

    I see you posted something new today about the Etsy widget. I’m glad I saw this – I tried to add the widget (as a small size) & everything on my blog totally disappeared! Scared me to death.

    I just disabled the widget & everything shows back up, thank goodness.

    I hope you are able to fix it ok – I’m assuming I should check back after Nov. 1?

  28. joshua says:

    Upgrading to version 1.0.7 should resolve any issues related to the recent API changes from Etsy. If you have the images set to an unavailable size it will default to 75×75.

    Also, you can now manually clear the cache by deactivating and reactivating the plugin.

  29. Windsweptgirlie says:


    I’m trying to activate your etsy widget version 1.0.8, which I installed via the wordpress plugin-search (install now) option. This installed the widget within the plugins area. But the pressing the “Activate” link causes a fatal error:

    Plugin could not be activated because it triggered a fatal error.

    Fatal error: Cannot redeclare widget_etsywp_register() (previously declared in /obsfucated/path/to/site/www.clairemaxwell.co.uk/blog/wp-content/plugins/etsy-widget/etsy-widget.php:15) in /obsfucated/path/to/site/www.clairemaxwell.co.uk/blog/wp-content/plugins/etsy-widget/etsy-widget.php on line 11

    If I visit the plugins page without deactivating the plugin, the plugins page is then broken, is does not list the plugins or the side bar.

    The site is running on a linux based server, although I do not have shell level access

    Please advise.

  30. Adrienne O says:

    Hey! I don’t know if Etsy changed something, but this plugin doesn’t work anymore. It says “403 Developer Over Rate”, and it was somehow making my WP admin links invisible…. so I had to disable it sorry :( I hope you can fix it cuz I really enjoyed the widget

  31. joshua says:

    Adrienne: Etsy phased out version 1 of their API. You need to upgrade to the latest version of the widget which uses version 2. Go to your plugins page, find the widget on the list, and click “update automatically”.

  32. Karen says:

    Thanks so much for creating this app. I love it! I just added CSS to center the widget in my left sidebar, and it works great, though the title didn’t center. If you have time could you clue me in on what I need to do to center “My Etsy Shop” as well? I used this code:
    text-align: center ;

    Thank you! :)

  33. joshua says:

    Karen: I think you mean the text at the top. In which case the css would be:

    .widget_etsywp h2{
    text-align: center;

    The reason it’s different is because this text falls outside the etsy div. The widget title like the other titles is styled using theme elements from the sidebar. If you want all your sidebar widgets to have centered titles use “.widget h2″ instead.

  34. carey says:

    Hi there – I just installed your etsy widget and am having the same issue as Windsweptgirlie above – “fatal error – cannot redeclare widget etc” The plugins panel however, says it is activated. When I go to appearance/widgets, you say to drag it to a sidebar, but there is no righthand sidebar there, and nothing is drag-able. Can send you a screenshot of this if you wish. Any suggestions?


  35. andy says:

    Plugin was working great with the ‘site address’ being the same as the ‘wordpress address’ like so: mydomain.com/wordpress/
    when I changed the ‘site address’ to root like so: mydomain.com I get the following type of error messages showing up before the etsy plugin (which still seems to work ok):

    Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/var/tmp) is not within the allowed path(s): (/usr/local/psa/home/vhosts/mydomain.com/httpdocs:/tmp:/usr/local/share/pear) in /usr/local/psa/home/vhosts/mydomain.com/httpdocs/wordpress/wp-content/plugins/etsy-widget/etsy-widget.php on line 174

    The Cache Location: is still set to: /var/tmp/ which was working fine until I moved the wordpress index page and site address to root. Any ideas?

  36. andy says:

    ignore my comment, it was my .htaccess file, all sorted now!

  37. Mike says:

    I need to change some of the initial settings. I have tried removing the widget, waiting 8 hours and re-installing but my original configuration is still there. How can I remove what I have and start over.


  38. Katie says:

    Hi Josh- I get this error when I try to activate your plug-in

    Fatal error: Call to undefined function: sys_get_temp_dir() in /homepages/35/d293004662/htdocs/wordpress/wp-content/plugins/etsy-widget/etsy-widget.php on line 197

    Any suggestions?


  39. Kim says:

    I’m getting the same error as Katie. Please help! It looks awesome and I really want to use it!


  40. joshua says:

    Katie and Kim: This error occurs when trying to run the widget with PHP 4. PHP 5.2.1 or later is required. Unless you chose version 4 for a specific reason you can probably simply upgrade to version 5. How to do this depends on your host, but if you look in the domain setup there should be a place to choose the PHP version.

  41. andy says:

    Currently when there are no items for sale in the Etsy shop the widget header and an empty table are are displayed.

    Is there a way to get the widget to not display at all if there are no items for sale in the Etsy shop? Or maybe still show the text link to the shop (which seems to disappear when there are no items available).

    Thanks, Andy

  42. Alisa says:

    Great Plugin! I’ve used it on both my sites:

    Love & Light

  43. Mike Panic says:

    Really like this widget, only I don’t want to run it in my “sidebar” in WP, aka drag & drop. Rather I want to manually insert it into single.php, as that will work best with my theme… is this possible?

  44. Heidi says:

    @Joshua – I read your answer to Katie and Kim.

    I am also receiving the same error in my installation!
    I am running Server version: 5.0.91 and receiving errors- does it have to be 5.2.1 or higher to run?

    It looks like a wonderful plugin and would be happy to use it!

  45. Nick says:

    Hi Josh, I like you plugin, but would love to use it in in page post instead of the sidebar. I’ve read that you will be working on this later, any hint on the release?

  46. Dan McKinney says:

    First, thank you very much for this plugin! I’ll be glad to forward via paypal a small donation if you can help me with one question.

    I am running WP 3.0.4 with MistLook 3.8RC I don’t like the extra little “drop down” frame that MistyLook puts around pictures in a gallery and with other graphics on the site. I use the following “hack” and it is very successful in blocking the extra frame thingee.


    .entry a img {


    But the modification to the style.php file does not affect the sidebar. If you check out my site, you will see that annoying extra frame (side and bottom) around the display of the etsy thumbnails in your sidebar widget. I tried adding that above code snippet to the bottom of your etsy-widget/etsy-widget.php file but I get a fatal error, etc.

    You can take a look at this page and see how the graphics look without the extra “drop shadow” frame added to the graphics.

    So, can you help us Misty Look fans out?

  47. Tim says:

    I saw someone ask above but is there a way to make the links target=”_blank”?

    Great work on the plugin!

  48. joshua says:


    Change line 117 to:

    $r .= '<a target="_blank" href="'.$item- rel="nofollow">url.'" title="'.$item->title.'"> <img src="'.$imgurl.'"/></a>' ;

    You could also change this in Javascript.

    You shouldn’t do this unless you have a really good reason. The user almost certainly doesn’t want it.

  49. hilary says:

    Hi Josh,

    I’m developing my first wp theme and I’d love to use your etsy app. I noticed no one above has mentioned the error I keep getting (after reinstalling twice):
    Fatal error: Call to undefined function curl_init() in J:\xampplite\htdocs\wordpress\wp-content\plugins\etsy-widget\etsy-widget.php on line 158
    The version of Xampp i’m using has PHP 5.3.1. Grateful for any suggestions.

  50. Tara Kamiya says:

    I keep getting an error message above the etsy box on my web page, what is this and how do I get rid of it:

    Warning: rename(d:\\temp\\tmp\\/etsysmartalecky_cache_tarakamiya.com.json16299.tmp,d:\\temp\\tmp\\/etsysmartalecky_cache_tarakamiya.com.json) [function.rename]: File exists in D:\Hosting\7586694\html\wp-content\plugins\etsy-widget\etsy-widget.php on line 166


  51. hilary says:

    I solved my issue: for anyone else using Xampp(lite) and getting the “Call to undefined function curl_init()” fatal error, try searching google for curl_init() and xampp. One solution is to go to “C:\xampp\php”, search for “php.ini”, in that file search for “extension=php_curl.dll” and uncomment it. So simple!

  52. ashley says:

    Hi there :) I run a WP multisite network, and have this plugin enabled for all of my users to activate/use on their sites. One of my users told me that she isn’t seeing the widget available on the widgets screen, so I logged in under her account to check, and was able to verify. The plugin is on the list for users to activate/deactivate, but activating it doesn’t make the widget appear on their appearance -> widgets screen for some reason. Any ideas?

  53. ashley says:

    ETA: I have also tried network enabling the plugin, but this had no effect on the issue.

  54. Melissa says:

    Hi Chris,
    Excellent Etsy widget! I absolutely love it. I installed it at http://diapercakeforbabyshower.com/ and it looks great and I am already seeing more traffic to our etsy site.

    I am interested in having a similar custom widget made for me. I will pay. Please email me to discuss if you are interested. It will probably be really easy for you since you already made this one.


  55. Stefan Witte says:

    Hi Chris,

    I’m working on the website of my girlfriend (http://www.jnnk.eu) – and I’m trying to change the appearance of the link-text.
    I want it positioned left (tricked it now with a lot of  ‘s) – and most importantly, the font to be changed to Courier.
    I’ve tried alot of things but can’t seem to get it working.
    Please help?


  56. Steven says:

    Hi Chris-

    I’ve followed your install instructions, activated Etsy Widget in Plugins, and set it up in Widgets, but the only thing it does is show the text of the Title, and this not a link. Any thoughts on what I’m doing wrong?


  57. Steven says:

    Very cool. Got it to work. Thanks for your help.

  58. Tuhannuak says:

    send you post: to my @hosutioi twitter

  59. julie says:

    I LOVE this plugin!!! I’m working on developing sites for my ebook subscribers. I’m using headwaythemes. I’m having trouble by only being able to use the plugin on 1 sidebar widget when creating a static site.

    For example I have it on 1 sidebar which will be the parent page but then on the blog page I need it to appear in a different widget and it doesn’t show again as an available widget to use.

    Any suggestions?

  60. Celeste says:

    I’m having the same problem that Chris mentioned above:
    I’ve followed your install instructions, activated Etsy Widget in Plugins, and set it up in Widgets, but the only thing it does is show the text of the Title, and this not a link.

    Can you help? Thanks!

  61. Alexandra says:

    Hi, I’ve done the easy install and drag and drop into my main sidebar, and nothing appears. I’ve uninstalled/reinstalled the widget, and still nothing – very frustrating – would love some help please!

  62. bettijo @ PagingSupermom.com says:

    I saw Michelle requested earlier to have the links open in a new window? Is there a workaround for this or is this something you might consider adding?

  63. bettijo @ PagingSupermom.com says:

    Thanks for the plugin by the way… sorry I didn’t mention that before ;)

  64. Jenn @ Home is Where You Start From says:


    great plugin, but I cannot get it to work. I’ve installed it and moved the widget to the sidebar, it looks a bit different then the example you have above- I think my problem is the very last box is titled ” cache location” and inside it is /tmp -I’m wondering if I need to put something there, and if so, what? please speak slowly- I am a computer klutz…! It shows on my sidebar but just with the title, no boxes, links or anything else.

    thanks :)

  65. Jon Baldry says:

    Hi Joshua,

    Great plugin and it’s working fine with one slight niggle. When I put a title into the Title: box for some reason when it shows on the web site, any capitalisation is removed, i.e. A selection from the Etsy shop becomes a selection from the etsy shop. I’m using the Version 1.0.8 plugin and WordPress 3.3.1. Any ideas on how to correct this please??

    Many thanks for your time.

  66. joshua says:

    @Bettijo This can be done by setting the target attribute of the links. Anyone with a little bit of php knowledge could do this, but it’s not a feature I’m going to include in the actual release.

    @Jenn You need to set this to a directory where php has write access. Ask your hosting provider.

    @Jon This is set by your theme. Look in the file style.css of your theme.

  67. ilana says:

    hi there – here’s the error i got
    Warning: shuffle() expects parameter 1 to be array, null given in /homepages/25/d321422027/htdocs/sugarandtype/wp-content/plugins/etsy-widget/etsy-widget.php on line 104

    any ideas?!

  68. Ilana says:

    mine’s still not working – if i turn random off it looks to be working – but nothing shows up! – no error though

  69. Kevin says:

    Thank you for making this. I wanted to suggest some features that would be very useful.

    1. Currently neither etsy mini or any other etsy widget that I can find lets you filter products by keyword. It seems in the day an age of niche marketing and targeting your audience this would have been available out of the box.

    2. Short code insertion and keyword parameter overrides. I would be great to directly insert this in my post as a 1×3 or 1×4 targeted by keyword. Perhaps something like [etsywidget keyword=”hat”]

  70. Emma says:

    Hi I like this widget, but when I added new items to my etsy shop, the widget did not reflect the new items but rather maintained images of the old items instead; it doesn’t seem to be updating and keeping current with my actual shop

  71. Emma says:

    oh i got it

  72. Emma M. says:

    Etsy now requires all plugins to access their API via HTTPS. Will this app be updated soon to meet this requirement? I hope so, because I love using it, but can’t anymore!

  73. cheyenne says:

    Hi Emma, Thanks for pointing it out. I haven’t looked at it in a long time but I’ll see what I can do. ~joshua

  74. Dana Huff says:

    Hi there,

    I just wanted to say that I went through the plugin code and changed the instances of “http” to “https” and it seems to have resolved the issue Emma M. was mentioning.

  75. Lee says:

    Just confirming that the fix is incredibly easy and you can do it easily enough in the wordpress interface by simply entering the plugin editor and changing the line

    $url = ‘http://openapi.etsy.com/v2/public/shops/’ . $uid . ‘/listings/active?


    $url = ‘https://openapi.etsy.com/v2/public/shops/’ . $uid . ‘/listings/active?

  76. Bill Weaver says:

    It looks like there is a problem with your current version and WordPress 3.8.1 I’m running for a client. In a sidebar the widget prevents any other widget below it from loading and on a home page bottom sidebar set up, eliminates the background CSS code.

    Is there a work around, or is this just an incompatibility issue between your current version and the current WP version?

  77. Nick says:

    Bill Weaver – this is happening because it is erroring out due to the http/https issue mentioned above and wordpress is terminating further display for some reason. Applying the simple fixes listed above should fix your problem. (They did for me.)

  78. David says:

    I also made this change and the Etsy plugin issue was resolved successfully. Also, a slider plugin was also not working and this change caused that plugin issue to be resolved as well.

  79. Julie C says:

    I also tried to make the above change but it did not work for me. Is there anything else I can do? Perhaps delete the plug in and re-install it?

  80. Julie C says:

    Never mind. I tried it again and it did work! Thanks!

  81. Drew says:

    Another option is the “Advanced Etsy Widget” (just google it) – it even has caching so your WordPress pages stay lightning fast.

Leave a Comment

Cheyenne Weil, Joshua Coxwell