


A comprehensive introduction to WooCommerce: Leveraging product tags, categories, and attributes
Aug 30, 2023 pm 09:57 PMIn the previous articles in this series about WooCommerce, I discussed the different setups and their configuration, including adding products. We then explored adding four different types of products along with featured images and product galleries.
In the product section, there are options for product tags, categories, and attributes. That’s what I’m going to discuss today.
Product Category
Generally speaking, categories act as filters that group all related posts into one place. This is also what categories do in WooCommerce, but this time categories are used to group all related products for the convenience of your customers. For example, the T-shirts category will contain a variety of T-shirts, the Hats category will contain a variety of hats, and so on.
In WooCommerce, product categories can be created from Products > Categories .
Add product category
Once you enter this section, you will find a category page almost identical to the one pictured above, where you can enter the Name, Slug, and DescriptionIf the newly created category is a child category of any parent category, you can also select 類別。如果新創(chuàng)建的類別是任何父類別的子類別,您還可以選擇Parent Category. Like any other post category, you can edit, update, and delete product categories.
You can use the drag and drop functionality to decide the order of categories (i.e. how they appear on the frontend).
Product categories have two different options than normal post categories. At the end of the page you can find the Display type and Thumbnails options.
Display type
Using this option you can decide how specific categories are displayed. You can find various options in the drop-down menu, such as Default, Product, Subcategory, and Both.
- Default: This will use the theme's default category display options. Some themes may display products, while others may display categories.
- Products: Viewers will see a list of all products under this category.
- Subcategories: Viewers will see many of all subcategories under this category.
- Both: Viewers will see subcategories and products on category pages.
Thumbnail
The name of this option explains its purpose quite well. It allows you to upload images for newly created categories. This image will be displayed on the front-end of your online store along with the category name. However, this image may not appear on all themes. It depends on how your theme is made.
After filling in the details, click Add New Product Category. The category will appear in an adjacent window listing all product categories on the Add Product page.
So, whenever you create any product in WooCommerce, you can check its related categories and/or subcategories.
WooCommerce also requires you to specify a default category that will apply to all products to which you do not explicitly assign a category. By default, the category is set to Uncategorized. However, you can also make any other category the default category. For example, if most of the products you add to your site are T-shirts, you can make them the default category.
One thing to also keep in mind is that default categories cannot be deleted. This means you won't be able to get rid of the "Uncategorized" category unless you set another category as the default.
product label
If you are uploading any content on the internet, you should ensure that your visitors can search for the content. Tags provide this opportunity to your visitors. If used correctly, these tags can get you ranked on Google as they are an excellent source of internal link multipliers.
We call tags in WooCommerce Product Tags. These product tags work similarly to publishing tags. But product labels are different from product categories. Product categories are often used for broad product categories such as T-shirts. Product labels, on the other hand, describe specific aspects of the product such as color, target customers, cost, etc. T-shirt labels can be casual, boys, blue, cotton, etc.
You can access product tags by navigating to Products > Tags through your WordPress admin navigation.
Add product tag
Once in this section, you will find the option to create a new product label. These options are identical to those for post tags. So, to create product tags in WooCommerce, fill in the Name, Slug, and Description fields. Then click the Add New Product Tag button and your work is done.
WooCommerce users can also add product tags directly through the Add Product page when creating products. Underneath the Product Categories section, you'll typically find a meta box for Product Tags. You can enter relevant tags here, separating each tag with a comma, and click the Add button.
I recommend that you don’t add a lot of tags to your posts. The general rule is to add a maximum of three tags per product.
To display product labels on the frontend, click the Save Draft or Update button. You will see results similar to the one shown above.
Delete product tag
If you want to remove a tag from a specific product, simply go to the edit page in your WordPress dashboard and find the meta box for Product Tags. Hover over the cross symbol that appears on each label. The cross mark will appear as red. Just click on it and that particular tab will disappear. But to remove it from your WordPress installation, you have to find it through the Products > Tags section. This is pretty much how we use post tags. product properties
I have mentioned product attributes many times in previous posts. Attributes allow you to define some additional technical information about your product, such as color, dimensions or weight. Attributes can also improve customers' browsing experience as they can better understand the product. Ideally, they are created the same way as product categories.
To create any new properties, go to
Product > Properties.
Add product attributes
As with categories and tags, the first two fields to fill in when creating any attribute are
and Slug. The next two options are
Enable archiving?as a checkbox, and default sort order as a drop-down menu. Enable archiving?
You can check this box to tell WooCommerce to create an archive page where users will be able to find all the products in your store that have a specific attribute value. For example, they can find all cotton clothing by visiting the link
yourwebsite.com/material/cotton.
Default sort order
This option controls the sort order of front-end terms that are part of the attribute. Users can choose between
Custom Sort, Name, Name (Number) and Term ID. If you choose Custom sorting, you can easily drag and drop various terms within the properties. Selecting Name will sort the elements alphabetically. Selecting name(number) will sort the elements in numerical order. You should consider choosing name(number) for the numeric value because sorting values ??of size (e.g. 9, 5 and 10) using name will give you 10, 5 and 9 instead of 5 , 9 and 10. After filling in all these fields, click the Add Attribute button. Once a product attribute is created, it will appear in an adjacent tab that will display all other product attributes. The image above shows such a representation where three properties are created, namely Color, Material and Size. Here you will see a new Term column that did not exist when I created the property. Terms The column contains the values ??of the attributes, for example the Color attribute has blue, green and red terms (values). Likewise, the "size" attribute also has the terms "large", "medium", and "small". However, Material properties have no such term. So the question is: how to add these terms? You can do this by clicking on the Configure Terms link that corresponds to the term Material. After clicking the link you will find a similar layout again to add terms to your properties. So, add as many terms as you like for the property using the Name, Slug, and Description fields, then click the Add New Material button. Determine the order of terms by dragging and dropping and your work is done. This concludes our exploration of the Products section in WooCommerce. This article has been updated with a contribution from Nitish Kumar. Nitish is a web developer with experience in creating e-commerce websites on various platforms. He spends his free time working on personal projects to make his daily life easier, or going for walks with friends in the evenings. Add terms to attributes
in conclusion
The above is the detailed content of A comprehensive introduction to WooCommerce: Leveraging product tags, categories, and attributes. For more information, please follow other related articles on the PHP Chinese website!

Hot AI Tools

Undress AI Tool
Undress images for free

Undresser.AI Undress
AI-powered app for creating realistic nude photos

AI Clothes Remover
Online AI tool for removing clothes from photos.

Clothoff.io
AI clothes remover

Video Face Swap
Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Article

Hot Tools

Notepad++7.3.1
Easy-to-use and free code editor

SublimeText3 Chinese version
Chinese version, very easy to use

Zend Studio 13.0.1
Powerful PHP integrated development environment

Dreamweaver CS6
Visual web development tools

SublimeText3 Mac version
God-level code editing software (SublimeText3)

The main reasons why WordPress causes the surge in server CPU usage include plug-in problems, inefficient database query, poor quality of theme code, or surge in traffic. 1. First, confirm whether it is a high load caused by WordPress through top, htop or control panel tools; 2. Enter troubleshooting mode to gradually enable plug-ins to troubleshoot performance bottlenecks, use QueryMonitor to analyze the plug-in execution and delete or replace inefficient plug-ins; 3. Install cache plug-ins, clean up redundant data, analyze slow query logs to optimize the database; 4. Check whether the topic has problems such as overloading content, complex queries, or lack of caching mechanisms. It is recommended to use standard topic tests to compare and optimize the code logic. Follow the above steps to check and solve the location and solve the problem one by one.

Miniving JavaScript files can improve WordPress website loading speed by removing blanks, comments, and useless code. 1. Use cache plug-ins that support merge compression, such as W3TotalCache, enable and select compression mode in the "Minify" option; 2. Use a dedicated compression plug-in such as FastVelocityMinify to provide more granular control; 3. Manually compress JS files and upload them through FTP, suitable for users familiar with development tools. Note that some themes or plug-in scripts may conflict with the compression function, and you need to thoroughly test the website functions after activation.

Methods to optimize WordPress sites that do not rely on plug-ins include: 1. Use lightweight themes, such as Astra or GeneratePress, to avoid pile-up themes; 2. Manually compress and merge CSS and JS files to reduce HTTP requests; 3. Optimize images before uploading, use WebP format and control file size; 4. Configure.htaccess to enable browser cache, and connect to CDN to improve static resource loading speed; 5. Limit article revisions and regularly clean database redundant data.

TransientsAPI is a built-in tool in WordPress for temporarily storing automatic expiration data. Its core functions are set_transient, get_transient and delete_transient. Compared with OptionsAPI, transients supports setting time of survival (TTL), which is suitable for scenarios such as cache API request results and complex computing data. When using it, you need to pay attention to the uniqueness of key naming and namespace, cache "lazy deletion" mechanism, and the issue that may not last in the object cache environment. Typical application scenarios include reducing external request frequency, controlling code execution rhythm, and improving page loading performance.

The most effective way to prevent comment spam is to automatically identify and intercept it through programmatic means. 1. Use verification code mechanisms (such as Googler CAPTCHA or hCaptcha) to effectively distinguish between humans and robots, especially suitable for public websites; 2. Set hidden fields (Honeypot technology), and use robots to automatically fill in features to identify spam comments without affecting user experience; 3. Check the blacklist of comment content keywords, filter spam information through sensitive word matching, and pay attention to avoid misjudgment; 4. Judge the frequency and source IP of comments, limit the number of submissions per unit time and establish a blacklist; 5. Use third-party anti-spam services (such as Akismet, Cloudflare) to improve identification accuracy. Can be based on the website

When developing Gutenberg blocks, the correct method of enqueue assets includes: 1. Use register_block_type to specify the paths of editor_script, editor_style and style; 2. Register resources through wp_register_script and wp_register_style in functions.php or plug-in, and set the correct dependencies and versions; 3. Configure the build tool to output the appropriate module format and ensure that the path is consistent; 4. Control the loading logic of the front-end style through add_theme_support or enqueue_block_assets to ensure that the loading logic of the front-end style is ensured.

To add custom user fields, you need to select the extension method according to the platform and pay attention to data verification and permission control. Common practices include: 1. Use additional tables or key-value pairs of the database to store information; 2. Add input boxes to the front end and integrate with the back end; 3. Constrain format checks and access permissions for sensitive data; 4. Update interfaces and templates to support new field display and editing, while taking into account mobile adaptation and user experience.

robots.txt is crucial to the SEO of WordPress websites, and can guide search engines to crawl behavior, avoid duplicate content and improve efficiency. 1. Block system paths such as /wp-admin/ and /wp-includes/, but avoid accidentally blocking the /uploads/ directory; 2. Add Sitemap paths such as Sitemap: https://yourdomain.com/sitemap.xml to help search engines quickly discover site maps; 3. Limit /page/ and URLs with parameters to reduce crawler waste, but be careful not to block important archive pages; 4. Avoid common mistakes such as accidentally blocking the entire site, cache plug-in affecting updates, and ignoring the matching of mobile terminals and subdomains.
