How to Remove sourcebuster.min.js From Woocommerce

Woocommerce has a new “feature” where it can list where an order came from. Cool!

Except, it’s pretty useless. Here’s a look at what we get:

screenshot of Woocommerce orders page

What does that last column even tell me? That one order is from “Direct” and the rest are “Unknown”? To be fair, other sites I manage show a bit more detail, but even then it’s just “Google Ads Campaign” and other generally unuseful data.

On the other hand, this new feature adds the following insane amount of junk to a webpage:

  • 39 lines of code
  • 20 Javascript files
  • 417kb in those 20 files

Don’t believe me? Download this ZIP file and count ’em yourself!

Personally, I enjoy speedy websites that don’t load a bunch of files, only to give me a column on one page of my admin screen with the word Unknown listed over and over again.

How to Remove sourcebuster.min.js from Woocommerce

Well, the easiest way to do so is to go to into the WP Admin ? Woocommerce ? Settings ? Advanced tab ? Features sub-tab, and then uncheck this Order Attribution box:

uncheck this order attribution checkbox

Want to do it with code? Pop this one liner in your functions.php, and never worry about it again.

update_option('woocommerce_feature_order_attribution_enabled','');

Bam, no more bloated website (at least not from this one feature.)

Up Next: WordPress: Enqueue jquery.min.js instead of jquery.js