How to Export Full Product URLs from WooCommerce (Easily, Without Breaking Anything!)

When working with WooCommerce, you quickly find that while the default product export system is great, sometimes it doesn’t quite give you everything you need.

In my case, I needed to export the full product URLs for all products in the store. This was so I could bulk import them into a URL shortening system for marketing purposes. Unfortunately, WooCommerce’s standard export file doesn’t include a direct column for the product URL.

Thankfully, WooCommerce is very extendable if you know how to hook into it. In this article, I’ll show you exactly how I added a Product URL column to my WooCommerce exports – and I’ll also share an easy way to add this code without touching your site’s functions.php file.


Why Add the Product URL to Exports?

Having the full URL for each product opens up a lot of options:

  • Creating marketing campaigns with direct links
  • Building custom reports
  • Bulk shortening URLs for social media
  • Feeding product data into other systems

By default, WooCommerce exports the product name, SKU, price, and other details – but it doesn’t include the full product link.


The Code Snippet

Here’s the custom snippet I used. It’s clean, lightweight, and works well on both the Export screen and the Product Import mappings (though importing the URL itself isn’t recommended – WooCommerce manages this for you, and it’s likely they will get overwritten).

Quick Overview:

  • Adds a new column labelled Product URL to your WooCommerce product export file
  • Fills it automatically with each product’s full URL
  • Leaves import logic alone (safe if you reuse your export files)

How I Added It (Without Directly Editing Files)

Rather than editing my theme’s functions.php file directly (which is risky and hard to maintain), I used the WPCode plugin.

WPCode allows you to:

  • Add code snippets safely through the WordPress admin
  • Control where and when they run (e.g. Admin only)
  • Enable or disable snippets individually for easier troubleshooting
  • Avoid losing your code during theme or plugin updates

I simply created a new PHP snippet inside WPCode, set it to run on the Admin side only, and pasted the above code into it.

If you’re managing custom tweaks like this, I highly recommend using a snippet manager like WPCode. It keeps your site clean, organised and much easier to maintain over time, plus you can easily import and export code snippets for use on other sites.


Final Thoughts

Adding the Product URL to WooCommerce exports is surprisingly simple once you know how to hook into WooCommerce’s export system.

With the WPCode plugin (or a similar tool), you can manage this and other customisations easily without touching your core theme files – a big win for anyone wanting to keep their site stable and update-friendly.

If you found this helpful, feel free to share it or leave a comment below. I’d love to hear how you’re using product URLs in your own workflows!

Leave a Reply

Your email address will not be published. Required fields are marked *