Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8882103
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 14, 20262026-06-14T20:29:38+00:00 2026-06-14T20:29:38+00:00

I am trying to edit an existing meta box that is being added by

  • 0

I am trying to edit an existing meta box that is being added by a plugin (WooCommerce) in WordPress, but I do not know how to do this.

The meta box is added with this line:

add_meta_box( 'woocommerce-product-data', __('Product Data', 'woocommerce'), 'woocommerce_product_data_box', 'product', 'normal', 'high' );

…so the function outputting the HTML to screen is woocommerce_product_data_box(). Is there any way to edit this function without loosing it all? I only want to remove parts of it and without editing the original function.

Can I accomplish this with filters somehow? Or any other ideas?

Thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-14T20:29:39+00:00Added an answer on June 14, 2026 at 8:29 pm

    You can find the actual function that writes the meta box for that in the writepanel-product_data.php file. At line 24:

    function woocommerce_product_data_box()
    

    That lists everything in the product data. You can add text boxes or drop downs by using the WooCommerce API. Find the place you’d like to add, or delete, then-

    For a text field –

    woocommerce_wp_text_input( array( 'id' => 'YOURCUSTOMID', 'class' => '', 'label' => __('THELABELOFTHEFIELD', 'woocommerce') ) );
    

    For a drop down –

    woocommerce_wp_select( array( 'id' => 'YOURCUSTOMID', 'label' => __('THELABELOFTHEFIELD', 'woocommerce'), 'options' => array(
                'OPTION1' => __('Option 1', 'woocommerce'),
                'OPTION2' => __('Option 2', 'woocommerce'),
                'OPTION3' => __('Option 3', 'woocommerce'),
                'OPTION4' => __('Option 4', 'woocommerce'),
                'OPTION5' => __('Option 5', 'woocommerce')
                ) ) );
    

    So, you give the input an ID, YOURCUSTOMID, and then label it whatever you want the admin to see when they are filling out the field, THELABELOFTHEFIELD.

    The same with custom meta boxes in WordPress posts/pages, you still have to save it, though. Find the function woocommerce_process_product_meta() somewhere around line 600. The comments above will tell you it is saving the meta box data. Then, insert a line of code to save whatever custom ID you just gathered –

     update_post_meta( $post_id, 'YOURCUSTOMID', stripslashes( $_POST['YOURCUSTOMID'] ) );
    

    and just change it for you custom ID. Just make sure you put that line of code anywhere after the globals are declared.

    Naturally, for removing fields, you can just comment out the fields that you don’t want gathered in both of those functions.

    Hope that helps.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to edit this submit tag to make it disable itself once I
I'm trying to edit the navigation bar but the last li is a little
I am new to vim so I was trying to edit an existing script
I realize that what I am trying to do isn't safe. But I am
I'm trying to inject some Scala code into my existing Java app. (So, being
I'm trying to edit an existing .proto file in VS2010 to add a new
I am trying to edit an already existing Flex project, and I see a
Note: my application is way more complicated but I'm stripping anything that is not
I'm trying to setup Python to execute nose, but only on an existing application
I am trying to generate java client library for my existing web application, but

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.