While using WordPress, you may need to exclude or hide certain categories from the categories widget.
There are some plugins available to achieve this, but inserting suitable code is advisable.
Here is the code:
$exclude = “1,15,22”; // The IDs of the excluding categories
$args[“exclude”] = $exclude;
Insert this code before ?> in theme function.php file.
(Note: The category numbers 1,15,22 is just for illustration. You need to replace with yours.)