Hide some items from Screen options in dashboard for products

I am trying to unset/hide some options in dashboard.

I am trying it for products screen.

Here is the screenshot

Here is the code i tried to hide SKU

/** Hide Dashboard widget by default via Screen Options */
add_filter( 'default_hidden_meta_boxes', 'wpfa_default_screen_option' );

function wpfa_default_screen_option( $hidden ) {
/** Add WP First Aid meta box ID to default hidden Screen Options array */
$hidden[] = 'sku-hide';

return $hidden;
}

Though it didn't work at all.

I need to hide these three items in screenshot.

Any Help will be appreciated.

Topic woocommerce-offtopic screen-options functions filters Wordpress

Category Web


The best option would be to use CSS to hide these columns and fields.

Add this in your admin.css file to hide the SKU column

table.wp-list-table .column-sku {
    width: 10%
}

To hide options in Screen Options add the following CSS in admin.css

.metabox-prefs label:nth-child(2), .metabox-prefs label:nth-child(11), .metabox-prefs label:nth-child(12)  {
        display: none;
}

FYI to double check my nth-child CSS as it may not be exact. Play around with your admin.css file while inspecting the element in the wp-admin backend.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.