Set Your WooCommerce Product SKU Right From The Frontend

If you are familiar with WordPress, you might know that most of its features of it are maintained from the backend. Though not everybody likes it this way. That's where plugins like WP User Frontend help WordPress users manage multiple parts of their website from the frontend for easy access.

And if you use WooCommerce with WordPress then you can get multiple advantages of using WP User Frontend. Today we will show you the process of one such example. Uploading SKU of a WooCommerce product right from the frontend when adding it.

What Is WooCommerce Product SKU?

Stock Keeping Unit is what the full abbreviation stands for. It is a unique ID that you can set against a product for inventory purposes. But in recent times if you are using WooCommerce for your eCommerce purposes, chances are that SKU can be used in multiple ways.

In certain conditions, customers can even find your products by searching them using its unique SKU. If you want to learn more about how having a WooCommerce product SKU can benefit you, click here.

How WooCommerce Product SKU Works

In WooCommerce, it is as simple as it gets when you are trying to get a unique identification against a product in your stock. Once you add a product to your WooCommerce store its SKU will be null by default.

When you go to wp-admin→Products→Your Product and edit the product you will see its configuration.

WooCommerce product SKU

Once you click on the edit option, you find all the available settings for that individual product. Scroll down and click on the inventory and there will be the option to set a WooCommerce product SKU.

WooCommerce product SKU

Here you can manually set the unique SKU for that product.

What Does WP User Frontend Bring To The Table

As you can see all of this happens from the backend of your WordPress website. But what if you want to do it from the frontend. That is where WP User Frontend brings its expertise. With its frontend solution features, you will be able to add product SKU right from the frontend of your site.

Creating A WooCommerce Product Upload Form

At first, you need to create a form that is used for uploading product details to your WooCommerce store. Go to wp-admin→User Frontend→Post Forms. There create a form for uploading WooCommerce products. For users, convenience WP User Frontend comes with a pre-built template for WooCommerce Product Upload.

WooCommerce product SKU

After creating your form you will find all the available fields on the right hand of your form builder. From there add a text field to your form.

WooCommerce product SKU

Now in the Field settings for that text insert _sku as the meta key. From the settings, you can set the SKU field to be required, set conditional logic for certain conditions and more.

WooCommerce product SKU

Save the form. Copy and paste the shortcode to create the WooCommerce Product upload page. That's all you need to set the product SKU right from the frontend using WP User Frontend. After publishing your form should look something similar to this.

WooCommerce product SKU

Fill up the form with the SKU that you want to set and submit the information. Your products will be automatically created in the WooCommerce products section. To view your recently added product  go to

wp-admin→Products→All Products

there you will find the product that you added with the SKU that you set using the frontend form.

WooCommerce product SKU

Bonus: Make Every SKU Unique

If you want to make sure that whoever uploads a product, sets a unique SKU only for that individual upload you can do that too. For that, you need to go to your functions.php file(which you find in the active theme folder root directory) and add a simple set of code. Don't worry, it's nothing tough.

there add the following line of codes. Please note you don't need to add the PHP start and end tag syntax from the following code.

https://gist.github.com/mahbubme/509de791831048ea6cfcfe79607b05c0

Now if anyone submits an SKU that was previously used it will show a warning urging the user to set a unique SKU.

Want To Learn More

WP User Frontend makes the front side of your WordPress the only place your users will ever need to use. It extends multiple backend options to the frontend. If you want to learn more about it you are always welcome.

WP User Frontend also comes in multiple pricing packages with extended features.

Mirza Rizvi Amin
Written by

Mirza Rizvi Amin

Rizvi is a tech enthusiast by heart. He loves to spend his time learning about the industry and how computational power is changing the future. Loves to read books or watch movies in his free time.

Have something to say? Cancel Reply

Your email address will not be published.

Table of Contents