Add product attribute columns to Woocommerce backend grid

If you have to extend the backend product grid of Woocommerce by an custom attribute , you have to follow the steps below to add product attribute columns to Woocommerce backend grid:

  1. Register and sort  the new columns via a filter hook (‘manage_edit-product_columns’):
  2. Add an action hook to fill in the respective value of each row (‘manage_product_posts_custom_column’):

For simplicity I only show the raw functions here. In general it is a really good Idea to encapsulate the code into a plugin class! 😉

Further information on how to add product attribute columns to Woocommerce backend grid

For this short article I was inspired by this Stack Overflow question:

https://stackoverflow.com/questions/23858236/how-to-add-remove-columns-in-woocommerce-admin-product-list

5 thoughts on “Add product attribute columns to Woocommerce backend grid

      1. You have ‘public’ before your functions, which should be used in class methods. I’m sure that’s what he’s referring to.

  1. Ah OK. Yes that could be. I think, the reason why this is working anyway is, that “public” is the default scope. What I can say for sure is, that it works for at least one of my stores like that.

Leave a Reply

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

 

This site uses Akismet to reduce spam. Learn how your comment data is processed.