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

I am trying it for products screen.

Here is the screenshot

Hide items marked in red

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.

1 Answer
1

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.

Leave a Reply

Your email address will not be published. Required fields are marked *