Colorectal cancer (CRC) is one of the most common malignant cancers worldwide. To reduce cancer mortality, early diagnosis and treatment are essential in leading to a greater improvement and survival length of patients. In this paper, a hybrid feature selection technique (RF-GWO) based on random forest (RF) algorithm and gray wolf optimization (GWO) was proposed for handling high dimensional and redundant datasets for early diagnosis of colorectal cancer (CRC). Feature selection aims to properly select the minimal most relevant subset of features out of a vast amount of complex noisy data to reach high classification accuracy. Gray wolf optimization (GWO) and random forest (RF) algorithm were utilized to find the most suitable features in the histological images of the human colorectal cancer dataset. Then, based on the best-selected features, the artificial neural networks (ANNs) classifier was applied to classify multiclass texture analysis in colorectal cancer. A comparison between the GWO and another optimizer technique particle swarm optimization (PSO) was also conducted to determine which technique is the most successful in the enhancement of the RF algorithm. Furthermore, it is crucial to select an optimizer technique having the capability of removing redundant features and attaining the optimal feature subset and therefore achieving high CRC classification performance in terms of accuracy, precision, and sensitivity rates. The Heidelberg University Medical Center Pathology archive was used for performance check of the proposed method which was found to outperform benchmark approaches. The results revealed that the proposed feature selection method (GWO-RF) has outperformed the other state of art methods where it achieved overall accuracy, precision, and sensitivity rates of 98.74%, 98.88%, and 98.63%, respectively.