Hide BackEnd Profile Custom Fields

Hey there,
Please, how can I hide 'shipping and billing information' (and other default fields, if possible) on BackEnd Profile Page of Staff Members?
Thanks!

  • Patrick

    Hey there @Albert

    I hope you're having a great day!

    The shipping and billing info sections are actually added to backend user profiles by the MarketPress plugin.

    They enable any user to enter/edit that information if/when they have purchased any product from your site, not just an appointment.

    However, there is no built-in option to remove those sections, and they cannot be targeted effectively with CSS or jQuery to hide them.

    I'll see if any other staff members and/or the developer of MarketPress have any ideas here.

  • Patrick

    Hi again @Albert

    Huzzah! Got a neat little jQuery solution for you thanks to @Sumit Kumar. :slight_smile:

    Add the following code to a custom plugin, and upload it to wp-content/plugins and network-activate it, or simply upload it to wp-content/mu-plugins so it automatically activates throughout the network and cannot be deactivated unless you delete it.

    function shipping_billing_remove() {
        if( ! is_admin() || ! is_super_admin() ){
            ?>
            <script type="text/javascript">
            //alert('loded');
                jQuery(function($) {
    
                    $('h3:contains("Shipping Info")').hide().next('table').remove();
                    $('h3:contains("Billing Info")').hide().next('table').remove();
                });
            </script>
            <?php
        }
    }
    add_action( 'admin_head', 'shipping_billing_remove' );

    If you're not sure how to make a plugin, I've included one for you here that includes the above code. Simply upload the zip to your site in Plugins > Add New > Upload and network-activate it.

    You can use it to add any other code bits to it that you want to apply across your entire network too.

    I hope this helps! And have fun :slight_smile:

Thank NAME, for their help.

Let NAME know exactly why they deserved these points.

Gift a custom amount of points.