• You MUST read the Babiato Rules before making your first post otherwise you may get permanent warning points or a permanent Ban.

    Our resources on Babiato Forum are CLEAN and SAFE. So you can use them for development and testing purposes. If your are on Windows and have an antivirus that alerts you about a possible infection: Know it's a false positive because all scripts are double checked by our experts. We advise you to add Babiato to trusted sites/sources or disable your antivirus momentarily while downloading a resource. "Enjoy your presence on Babiato"

Help me hiding woocommerce store management section using admin css?

Iron-Man

Active member
Babiato Lover
Oct 9, 2019
304
87
28
29
India
Please see the screenshot:

woo hide stock management tab 1.png

I am trying to hide the store management section either fully (1) or partially at least (2); but unable to do it. I tried to find the right element and when try to hide, it completely hide the whole page. I just want to hide this store management section 1 or 2.

So if anyone know the right css code please give me. Thanks in advance.
 
You just need to target the correct class.

In this case is this one:
1664370038928.png
Thanks.

I use this code:

.css-xuyuoy{
display: none!important;
}

But still the store management header is present.
fsdfsd.PNG

I can't fine right css or target class to hide it. Plz help.
 
If you dont want to use this section you can remove completely?

Try this one (It can be display error when you click woocommerce main menu but sub menus will work)

paste this code your child theme functions.php file

Code:
function strposa( string $haystack, array $needles, int $offset = 0 ) : bool {
    foreach ( $needles as $needle ) {
        if ( strpos( $haystack, $needle, $offset ) !== false ) {
            return false; // stop on first true result
        }
    }

    return true;
}

function action_admin_menu() {
    // Contains the URI of the current page.
    $current_url = $_SERVER['REQUEST_URI'];

    // Pages that must remain accessible
    $should_still_work = array( 'customers', 'analytics', 'marketing' );
    
    // Make sure some wc-admin pages will still work
    if ( strposa( $current_url, $should_still_work ) ) {
        remove_submenu_page( 'woocommerce', 'wc-admin' );
    }
}
add_action( 'admin_menu', 'action_admin_menu', 99, 0 );
 
  • Like
Reactions: Iron-Man
You just need do inspect your site and choose the class of the element you want to hide. Check tutorials on youtube.

1664371438768.png
I tried by using that css class, but it did not worked properly.

See the screenshot:
error.PNG

Also after observing your way to finding right class of element, I am also trying, but unable to find the right one which works.

Capture333.PNG
 
If you dont want to use this section you can remove completely?

Try this one (It can be display error when you click woocommerce main menu but sub menus will work)

paste this code your child theme functions.php file

Code:
function strposa( string $haystack, array $needles, int $offset = 0 ) : bool {
    foreach ( $needles as $needle ) {
        if ( strpos( $haystack, $needle, $offset ) !== false ) {
            return false; // stop on first true result
        }
    }

    return true;
}

function action_admin_menu() {
    // Contains the URI of the current page.
    $current_url = $_SERVER['REQUEST_URI'];

    // Pages that must remain accessible
    $should_still_work = array( 'customers', 'analytics', 'marketing' );
   
    // Make sure some wc-admin pages will still work
    if ( strposa( $current_url, $should_still_work ) ) {
        remove_submenu_page( 'woocommerce', 'wc-admin' );
    }
}
add_action( 'admin_menu', 'action_admin_menu', 99, 0 );

Thanks for replay. Actually i want to keep the section, only want to hide the 'Store management' section. I am already using admin menu editor pro, so I could hide this menu item any time. But I just want to hide this subsection. Anyway, thanks for your replay.
 
Thanks for replay. Actually i want to keep the section, only want to hide the 'Store management' section. I am already using admin menu editor pro, so I could hide this menu item any time. But I just want to hide this subsection. Anyway, thanks for your replay.
use this one:
.css-1pd4mph {display: none !important}
 
  • Like
Reactions: Iron-Man
Tried, same issue like this screenshot, it is hiding other subsections too:

er2.PNG
As I said before you could not achive via CSS because used same class names in other "cards" so you should find a method whcih is "remove" section instead of "hiding"
 
  • Like
Reactions: Iron-Man
As I said before you could not achive via CSS because used same class names in other "cards" so you should find a method whcih is "remove" section instead of "hiding"
Hmm, now I understand after so many trial-error. I guess there is no perfect way.
 
If store management section is the last section in your woocommerce dashboard try the following:

Code:
.woocommerce-homescreen-column > div:last-child {
  display: none !important;
}
 
  • Love
Reactions: Iron-Man
If store management section is the last section in your woocommerce dashboard try the following:

Code:
.woocommerce-homescreen-column > div:last-child {
  display: none !important;
}
WOWWWW. Finally your code is working perfectly without any issue. Thank you very very much @Hardii 🙏✌✌✌.
 
  • Like
Reactions: Hardii
AdBlock Detected

We get it, advertisements are annoying!

However in order to keep our huge array of resources free of charge we need to generate income from ads so to use the site you will need to turn off your adblocker.

If you'd like to have an ad free experience you can become a Babiato Lover by donating as little as $5 per month. Click on the Donate menu tab for more info.

I've Disabled AdBlock