Docly

How to create a custom field using ACF

Estimated reading: 2 minutes

When we need to show an extra field in our WooCommerce Product we should create a custom field.

Time needed: 5 minutes

To create custom fields you need to install first Advanced Custom Fields plugin.
After installation, you will see a new menu ACF added in the WordPress dashboard.

  1. First click on the Fields Group

    From ACF menu click Field Froups option.

  2. Now click on "Add New."

    To add a new field group, please click on Add New.

  3. Give  Field Group a name.

    The first step would be to give a proper name to the field groups to understand better.

  4. Set a fields

    The next several steps will be about how to set up a field.
    Field Type -> Select a type from the dropdown menu.
    Field Label -> Give the field a name.
    Field Name -> This is very important. Data will be saved by this name and you need to use this name to get data from the database.
    Default Value -> Not necessary but you can set a default value from here.

  5. Settings rules.

    You have to set the rules, where this custom field will be added.

  6. Save and publish.

    After setting up everything, click on Save Changes. Field data will be safe and you will get a notification. ( Field group published )

  7. Result

    Since I have set the custom field for the product, I will get an input box to add a custom field.

Share this Doc
CONTENTS