Ok, this is a little hacky and pretty manual, but it happened to me in the past that the inbuilt WooCommerce CSV product export was just not enough.
In other words, the default product export that you can find by clicking the “Export” button on the “Products” WordPress Dashboard screen, gives you the option to export all products to a CSV. You can also refine the list by product type and product category, so that you can export specific products only.
What’s missing there is a “product tag” filter, so this workaround will let you do just that – define a product tag slug in the snippet below, and your export list will be automatically filtered by that.
Of course, you could find a dynamic way of doing that, but for now we’ll keep this manual and hardcoded into the PHP function. Enjoy!
PHP Snippet: Filter CSV Product Export By Product Tag @ WordPress Dashboard
This code still works, unless you report otherwise. To exclude conflicts, temporarily switch to the Storefront theme, disable all plugins except WooCommerce, and test the snippet again: WooCommerce troubleshooting 101
WooCommerce: Import California Tax Rates (.csv) It took me ages to find a way to import ALL California tax rates into WooCommerce. I started by hand, and after a while I said to myself “California is crazy! I wouldn’t want to be an accountant there!”. As usual, I looked for existing free and premium plugins, but I decided to do it […]
WooCommerce: How to Export/Import Products Maybe you don’t know that, but WooCommerce has an inbuilt functionality for importing and exporting products from CSV/XML files. Therefore, most of the times, you don’t need a premium import/export plugin. Simply go to WordPress Dashboard > Products > All Products and click on Import (or Export) and follow the instructions. That’s it! This is […]
WooCommerce: Get Product IDs (All, by Tag, by Category) When you work with WooCommerce PHP snippets, you often need to “get” stuff off your WordPress database in order to make some calculations and return the result on the screen. And if there is something I often google is “How do I get all my store’s product IDs?“. Thankfully the wc_get_products WooCommerce function gives us […]
WooCommerce: Truncate Tag List @ Single Product Page If you use WooCommerce product tags, it’s possible that a product may belong to 10 or more of them. When that happens, the single product page displays a long list of tag links, which may take too much space (see the below screenshot to visualize this). Today’s snippet is indeed a way to truncate that […]
Author, WooCommerce expert and WordCamp speaker, Rodolfo has worked as an independent WooCommerce freelancer since 2011. His goal is to help entrepreneurs and developers overcome their WooCommerce nightmares. Rodolfo loves travelling, chasing tennis & soccer balls and, of course, wood fired oven pizza. Follow @rmelogli