Blockages in the centrifugal pump, either upstream or downstream, reduce the pump's flow rate, and if left unnoticed for prolong periods, it can result in cavitation and overheating. These can damage the pump components, thereby affecting its performance predictability and reliability. Therefore, it is imperative to detect blockage fault in a centrifugal pump. In this study, an experimental facility is developed to simulate two types of blockages, namely the suction blockage and discharge blockage. To capture the pump's response under healthy versus blockage conditions, the pressure sensors are installed at both suction and discharge while a flowmeter is installed at the discharge side. For the signals acquired from each of the sensors, twelve different statistical features are extracted. Subsequently, the relevance of these features is evaluated based on the classification error rate and the feature selection ratio using the butterfly optimization technique. With this technique, the feature vector space is reduced significantly by 65-83% of the total extracted features. Subsequently, these selected features are fed to the XGBoost ensemble classifier that detects the blockage condition of the pump with a nominally high classification accuracy ranging from 90 to 100%. This study demonstrates that the blockage fault in a centrifugal pump can be detected accurately by maintaining the smallest number of features using the butterfly optimization algorithm and applying the same to XGBoost.